Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Normal
XF\Entity\CoverImageTrait::getCoverImageInternal()[php]/** @var Attachment $attachment */if ($embeddedAttachments[$attachment->attachment_id]){ continue;}[/php]This calls \XF\Mvc\AbstractCollection::offsetGet()[php]public function offsetGet($key): ?Entity{ return $this->entities[$key];}[/php]As can be seen, this directly accesses the internal array without checking if the key exists, so if it does not exist this generates a warning Undefined array key ...It's a bit tricky to actually see this warning as \XF\Template\Templater::handleTemplateError() hides it so this needs to be called by code outside of templater context.
XF\Entity\CoverImageTrait::getCoverImageInternal()
[php]
/** @var Attachment $attachment */
if ($embeddedAttachments[$attachment->attachment_id])
{
continue;
}
[/php]
This calls \XF\Mvc\AbstractCollection::offsetGet()
\XF\Mvc\AbstractCollection::offsetGet()
public function offsetGet($key): ?Entity
return $this->entities[$key];
As can be seen, this directly accesses the internal array without checking if the key exists, so if it does not exist this generates a warning Undefined array key ...
It's a bit tricky to actually see this warning as \XF\Template\Templater::handleTemplateError() hides it so this needs to be called by code outside of templater context.
\XF\Template\Templater::handleTemplateError()
We use essential cookies to make this site work, and optional cookies to enhance your experience.
See further information and configure your preferences