This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Useful util func for debugging PHP. When var_dump and print_r blows the stack, I use this instead. | |
* Eg: die("<pre>".preg_replace("/</", "<", safe_print_r($my_bloated_circular_object))."</pre>"); | |
* Heavily inspired by the comments on: https://www.php.net/manual/en/function.print-r.php | |
*/ | |
function safe_print_r($data, $nesting = 6, $indent = '') | |
{ | |
$in = ' '; | |
if (!is_object($data) && !is_array($data)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/Form/UserRevisionDeleteForm.php b/src/Form/UserRevisionDeleteForm.php | |
index cb7f0ce..3d3237f 100644 | |
--- a/src/Form/UserRevisionDeleteForm.php | |
+++ b/src/Form/UserRevisionDeleteForm.php | |
@@ -42,7 +42,7 @@ class UserRevisionDeleteForm extends ConfirmFormBase { | |
* {@inheritdoc} | |
*/ | |
public static function create(ContainerInterface $container) { | |
- $entity_manager = $container->get('entity.manager'); | |
+ $entity_manager = $container->get('entity_type.manager'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -ru a/viewsreference/src/Plugin/Field/FieldFormatter/ViewsReferenceFieldFormatter.php b/viewsreference/src/Plugin/Field/FieldFormatter/ViewsReferenceFieldFormatter.php | |
--- a/src/Plugin/Field/FieldFormatter/ViewsReferenceFieldFormatter.php | |
+++ b/src/Plugin/Field/FieldFormatter/ViewsReferenceFieldFormatter.php | |
@@ -100,6 +100,9 @@ | |
} | |
$node = \Drupal::routeMatch()->getParameter('node'); | |
+ if ($items->getEntity() instanceof \Drupal\node\NodeInterface) { | |
+ $node = $items->getEntity(); | |
+ } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -ru a/viewsreference/src/Plugin/Field/FieldFormatter/ViewsReferenceFieldFormatter.php b/viewsreference/src/Plugin/Field/FieldFormatter/ViewsReferenceFieldFormatter.php | |
--- a/src/Plugin/Field/FieldFormatter/ViewsReferenceFieldFormatter.php | |
+++ b/src/Plugin/Field/FieldFormatter/ViewsReferenceFieldFormatter.php | |
@@ -100,6 +100,9 @@ | |
} | |
$node = \Drupal::routeMatch()->getParameter('node'); | |
+ if (!$node && $items->getEntity() instanceof \Drupal\node\NodeInterface) { | |
+ $node = $items->getEntity(); | |
+ } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -ru a/src/Normalizer/FileEntityNormalizer.php b/file_entity/src/Normalizer/FileEntityNormalizer.php | |
--- a/src/Normalizer/FileEntityNormalizer.php | |
+++ b/src/Normalizer/FileEntityNormalizer.php | |
@@ -48,6 +48,7 @@ | |
else { | |
throw new \RuntimeException(SafeMarkup::format('Failed to write @filename.', array('@filename' => $entity->getFilename()))); | |
} | |
+ $entity->status = FILE_STATUS_PERMANENT; | |
return $entity; | |
} |