File tree Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change 131131 "after" : [
132132 " resolve.synctables.php" ,
133133 " resolve.defaulttheme.php" ,
134- " resolve.migration.php"
134+ " resolve.migration.php" ,
135+ " resolve.placehold.php"
135136 ]
136137 }
137138 }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ if ($ object ->xpdo ) {
4+ switch ($ options [xPDOTransport::PACKAGE_ACTION ]) {
5+ case xPDOTransport::ACTION_UPGRADE :
6+ /** @var modX $modx */
7+ $ modx =& $ object ->xpdo ;
8+ $ c = $ modx ->newQuery ('FredElement ' );
9+ $ c ->where (['image:LIKE ' => 'https://via.placeholder.com/% ' ]);
10+ $ elements = $ modx ->getCollection ('FredElement ' , $ c );
11+ foreach ($ elements as $ element ) {
12+ $ image = $ element ->get ('image ' );
13+ $ image = str_replace ('https://via.placeholder.com/ ' , 'https://placehold.co/ ' , $ image );
14+ $ element ->set ('image ' , $ image );
15+ $ element ->save ();
16+ }
17+
18+ $ c = $ modx ->newQuery ('FredBlueprint ' );
19+ $ c ->where (['image:LIKE ' => 'https://via.placeholder.com/% ' ]);
20+ $ blueprints = $ modx ->getCollection ('FredBlueprint ' , $ c );
21+ foreach ($ blueprints as $ blueprint ) {
22+ $ image = $ blueprint ->get ('image ' );
23+ $ image = str_replace ('https://via.placeholder.com/ ' , 'https://placehold.co/ ' , $ image );
24+ $ blueprint ->set ('image ' , $ image );
25+ $ blueprint ->save ();
26+ }
27+ break ;
28+ }
29+ }
30+ return true ;
You can’t perform that action at this time.
0 commit comments