Skip to content

Instantly share code, notes, and snippets.

@kimpepper
Created March 9, 2013 05:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kimpepper/5122846 to your computer and use it in GitHub Desktop.
Save kimpepper/5122846 to your computer and use it in GitHub Desktop.
diff --git a/core/modules/breakpoint/lib/Drupal/breakpoint/Plugin/Core/Entity/BreakpointGroup.php b/core/modules/breakpoint/lib/Drupal/breakpoint/Plugin/Core/Entity/BreakpointGroup.php
index 334d2cb..e6c835b 100644
--- a/core/modules/breakpoint/lib/Drupal/breakpoint/Plugin/Core/Entity/BreakpointGroup.php
+++ b/core/modules/breakpoint/lib/Drupal/breakpoint/Plugin/Core/Entity/BreakpointGroup.php
@@ -99,6 +99,30 @@ public function __construct(array $values, $entity_type) {
}
/**
+ * Overrides Drupal\config\ConfigEntityBase::set().
+ *
+ * Special handling for setting the breakpoints property so we always load the
+ * breakpoint entities during ConfigStorageController::importChange.
+ *
+ * @see BreakpointGroup::save().
+ */
+ public function set($property_name, $value, $langcode = NULL) {
+ if ($property_name == 'breakpoints') {
+ if (is_array($value)) {
+ foreach ($value as $value_item) {
+ if (is_string($value_item)) {
+ $this->addBreakpoints($value);
+ }
+ break;
+ }
+ }
+ }
+ else {
+ parent::set($property_name, $value, $langcode);
+ }
+ }
+
+ /**
* Overrides Drupal\Core\Entity\Entity::save().
*/
public function save() {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment