- Status changed to RTBC
2 months ago 10:46am 8 July 2024 - 🇮🇳India chaitanyadessai
Installed panels version 8.x-4.8 on drupal 10.3.1, executed composer update command, no duplicate function id() got added.
Every time composer updates, website errors out with the following:
PHP Fatal error: Cannot redeclare Drupal\panels\Plugin\DisplayVariant\PanelsDisplayVariant::id() in C:\[...]\modules\contrib\panels\src\Plugin\DisplayVariant\PanelsDisplayVariant.php on line 582
At the bottom of said file, this function appears twice:
public function id() {
// Explicit IPE/Panelizer Support.
if (!empty($this->getContexts()['@panelizer.entity_context:entity']) && $this->getContexts()['@panelizer.entity_context:entity']->hasContextValue()) {
return $this->getContexts()['@panelizer.entity_context:entity']->getContextValue()->uuid();
}
// If the panelizer context isn't available, just return our uuid.
return parent::id();
}
public function id() {
// Explicit IPE/Panelizer Support.
if (!empty($this->getContexts()['@panelizer.entity_context:entity']) && $this->getContexts()['@panelizer.entity_context:entity']->hasContextValue()) {
return $this->getContexts()['@panelizer.entity_context:entity']->getContextValue()->uuid();
}
// If the panelizer context isn't available, just return our uuid.
return parent::id();
}
I have to manually comment out the second declaration every time, which fixes the error until the next update, then it comes back.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Installed panels version 8.x-4.8 on drupal 10.3.1, executed composer update command, no duplicate function id() got added.