File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -36,12 +36,15 @@ public function beforeSave(
3636 BlockRepositoryInterface $ subject ,
3737 BlockInterface $ block
3838 ): array {
39- if ($ this ->moduleConfig ->isBlockIdentifierMarkupEnabled () && $ block ->getIdentifier ()) {
39+ if ($ this ->moduleConfig ->isBlockIdentifierMarkupEnabled ()
40+ && ($ identifier = $ block ->getIdentifier ())
41+ && ($ content = $ block ->getContent ())
42+ ) {
4043 $ block ->setContent (
4144 substr_replace (
42- $ block -> getContent () ,
43- " data- { $ this ->moduleConfig ->getBlockIdentifierDataAttributeName ()} = \"{ $ block -> getIdentifier ()}\"" ,
44- strpos ($ block -> getContent () , ' ' ) ,
45+ $ content ,
46+ ' data- ' . $ this ->moduleConfig ->getBlockIdentifierDataAttributeName () . ' =" ' . $ identifier . ' " ' ,
47+ strpos ($ content , '<div ' ) + 4 ,
4548 0
4649 )
4750 );
You can’t perform that action at this time.
0 commit comments