Loading src/Form/BlockClassConfirmBulkOperationForm.php +54 −59 Original line number Diff line number Diff line Loading @@ -111,8 +111,9 @@ class BlockClassConfirmBulkOperationForm extends ConfirmFormBase { foreach ($blocks as $block) { // If is insert include this class to all blocks. if ($this->operation == 'insert') { switch ($this->operation) { case 'insert': // Get the current block classes configured. $current_classes = $block->getThirdPartySetting('block_class', 'classes'); Loading @@ -132,10 +133,7 @@ class BlockClassConfirmBulkOperationForm extends ConfirmFormBase { // Go to the next iteration. continue; } // If is insert include this attribute to all blocks. if ($this->operation == 'insert_attributes') { case 'insert_attributes': // Get the current block attributes configured. $current_attributes = $block->getThirdPartySetting('block_class', 'attributes'); Loading @@ -155,17 +153,14 @@ class BlockClassConfirmBulkOperationForm extends ConfirmFormBase { // Go to the next iteration. continue; } // If is update get all values to update. if ($this->operation == 'update') { case 'update': // Get the current block classes configured. $current_block_classes = $block->getThirdPartySetting('block_class', 'classes'); // If the current block class doesn't have this current class, skip. if (!preg_match("/\b" . $this->currentClass . "\b/i", $current_block_classes)) { return; continue; } // Update the new block classes value with this replace. Loading @@ -180,9 +175,7 @@ class BlockClassConfirmBulkOperationForm extends ConfirmFormBase { // Go to the next iteration. continue; } if ($this->operation == 'delete') { case 'delete': // If there is ThirdPartySetting remove that. $block->unsetThirdPartySetting('block_class', 'classes'); Loading @@ -190,9 +183,9 @@ class BlockClassConfirmBulkOperationForm extends ConfirmFormBase { // Block save. $block->save(); } continue; if ($this->operation == 'delete_attributes') { case 'delete_attributes': // If there is ThirdPartySetting remove that. $block->unsetThirdPartySetting('block_class', 'attributes'); Loading @@ -200,6 +193,8 @@ class BlockClassConfirmBulkOperationForm extends ConfirmFormBase { // Block save. $block->save(); continue; } } Loading Loading
src/Form/BlockClassConfirmBulkOperationForm.php +54 −59 Original line number Diff line number Diff line Loading @@ -111,8 +111,9 @@ class BlockClassConfirmBulkOperationForm extends ConfirmFormBase { foreach ($blocks as $block) { // If is insert include this class to all blocks. if ($this->operation == 'insert') { switch ($this->operation) { case 'insert': // Get the current block classes configured. $current_classes = $block->getThirdPartySetting('block_class', 'classes'); Loading @@ -132,10 +133,7 @@ class BlockClassConfirmBulkOperationForm extends ConfirmFormBase { // Go to the next iteration. continue; } // If is insert include this attribute to all blocks. if ($this->operation == 'insert_attributes') { case 'insert_attributes': // Get the current block attributes configured. $current_attributes = $block->getThirdPartySetting('block_class', 'attributes'); Loading @@ -155,17 +153,14 @@ class BlockClassConfirmBulkOperationForm extends ConfirmFormBase { // Go to the next iteration. continue; } // If is update get all values to update. if ($this->operation == 'update') { case 'update': // Get the current block classes configured. $current_block_classes = $block->getThirdPartySetting('block_class', 'classes'); // If the current block class doesn't have this current class, skip. if (!preg_match("/\b" . $this->currentClass . "\b/i", $current_block_classes)) { return; continue; } // Update the new block classes value with this replace. Loading @@ -180,9 +175,7 @@ class BlockClassConfirmBulkOperationForm extends ConfirmFormBase { // Go to the next iteration. continue; } if ($this->operation == 'delete') { case 'delete': // If there is ThirdPartySetting remove that. $block->unsetThirdPartySetting('block_class', 'classes'); Loading @@ -190,9 +183,9 @@ class BlockClassConfirmBulkOperationForm extends ConfirmFormBase { // Block save. $block->save(); } continue; if ($this->operation == 'delete_attributes') { case 'delete_attributes': // If there is ThirdPartySetting remove that. $block->unsetThirdPartySetting('block_class', 'attributes'); Loading @@ -200,6 +193,8 @@ class BlockClassConfirmBulkOperationForm extends ConfirmFormBase { // Block save. $block->save(); continue; } } Loading