We're seeing a problem with RequestTranslationSubscriber.php under PHP7 when uploading content. We get the following error:
ResponseText: Error: Cannot pass parameter 3 by reference in Drupal\tmgmt_smartling\EventSubscriber\RequestTranslationSubscriber->onUploadRequest() (line 42 of /var/www/pin_business/docroot/modules/contrib/tmgmt_smartling/src/EventSubscriber/RequestTranslationSubscriber.php).
Looking at that code, the link is question is:
\Drupal::moduleHandler()->alter('tmgmt_smartling_context_url', $url, clone $item);
where the third parameter goes to a reference variable.
This would work without complaint under PHP5, but under PHP7 it causes a fatal error.
A bit of variable juggling makes this work:
$cloned_item = clone $item;
\Drupal::moduleHandler()->alter('tmgmt_smartling_context_url', $url, $cloned_item);
Comments
Comment #2
timcosgrove commentedAttached resolves the issue for us.
Comment #3
gg4 commentedLGTM, but I am probably too close to the fix to RBTC.
Comment #5
loparev commentedThank you, @timcosgrove and @bonus.
Comment #6
loparev commented