File tree 2 files changed +32
-1
lines changed
2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change 131
131
"after" : [
132
132
" resolve.synctables.php" ,
133
133
" resolve.defaulttheme.php" ,
134
- " resolve.migration.php"
134
+ " resolve.migration.php" ,
135
+ " resolve.placehold.php"
135
136
]
136
137
}
137
138
}
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