Bruno17 / MIGX

MIGX for revo 2.2 and above
83 stars 78 forks source link

Remove PHP 8 warnings #417

Closed halftrainedharry closed 2 months ago

halftrainedharry commented 8 months ago

Update processor

If no 'packageName' is defined (e.g. for MODX 3 classes), the update processor generates a Undefined variable $packageName warning. If there is a 'packageName', the lexicon gets already loaded a few lines above the deleted code.


this.renderChunk renderer

If the 'this.renderChunk' renderer is used for a grid column, the code generates a Undefined array key "media_source_id" warning. See issue #416

This is probably not the best way to fix this issue as $this->config['media_source_id'] seems to never exist. Maybe $this->customconfigs['media_source_id'] should be used instead. Or more elaborate code like:

if (isset($this->customconfigs['media_source_id'])) {
    $properties['_media_source_id'] = $this->customconfigs['media_source_id'];
} else {
    $properties['_media_source_id'] = is_object($this->source) ? $this->source->id : $this->getDefaultSource('id');
}