Conditions | 2 |
Paths | 2 |
Total Lines | 22 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
22 | public function onAfterDuplicateToSubsite($originalPage) |
||
23 | { |
||
24 | /** @var ElementalArea $originalElementalArea */ |
||
25 | $originalElementalArea = $originalPage->getComponent('ElementalArea'); |
||
26 | |||
27 | $duplicateElementalArea = $originalElementalArea->duplicate(false); |
||
28 | $duplicateElementalArea->write(); |
||
29 | |||
30 | $this->owner->ElementalAreaID = $duplicateElementalArea->ID; |
||
31 | $this->owner->write(); |
||
32 | |||
33 | foreach ($originalElementalArea->Items() as $originalElement) { |
||
34 | /** @var BaseElement $originalElement */ |
||
35 | $duplicateElement = $originalElement->duplicate(true); |
||
36 | |||
37 | // manually set the ParentID of each element, so we don't get versioning issues |
||
38 | DB::query( |
||
39 | sprintf( |
||
40 | "UPDATE %s SET ParentID = %d WHERE ID = %d", |
||
41 | DataObject::getSchema()->tableName(BaseElement::class), |
||
42 | $duplicateElementalArea->ID, |
||
43 | $duplicateElement->ID |
||
44 | ) |
||
49 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths