- Issue created by @lisagodare@gmail.com
- Open on Drupal.org βCore: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7last update
over 1 year ago Waiting for branch to pass - @lisagodaregmailcom opened merge request.
- Open on Drupal.org βCore: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7last update
over 1 year ago Waiting for branch to pass - @lisagodaregmailcom opened merge request.
- Open on Drupal.org βCore: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7last update
over 1 year ago Waiting for branch to pass - Status changed to Needs work
over 1 year ago 8:14pm 18 May 2023 - πΊπΈUnited States apmsooner
@lisagodare, the hook_insert is incorrect in the patch.
- Open on Drupal.org βCore: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7last update
over 1 year ago Waiting for branch to pass - Status changed to Needs review
over 1 year ago 10:50pm 18 May 2023 - πΊπΈUnited States lisagodare@gmail.com
Well that's embarrassing. Thanks for calling it out!
- Open on Drupal.org βCore: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7last update
over 1 year ago Waiting for branch to pass - πΊπΈUnited States steyep
I'm not sure that having a
$special_types
array is sufficient. It does allow for the builds to be triggered but the GatsbyEntityLogger still only marks a build as published if it has theisPublished
method and that method returns true (https://git.drupalcode.org/project/gatsby/-/blob/2.0.x/src/GatsbyEntityL...). This can prevent the files from being available to Gatsby when builds are triggered.I wonder if a more extensible approach might be to dispatch an event that allows other modules to determine if an entity is published. At the very least, I would suggest adding an
isEntityPublished
method to the GatsbyPreview service that is used instead of relying on a method that doesn't exist for all supported entities. Something like this:/** * Determine if a given entity is considered "published". * * @param \Drupal\Core\Entity\EntityInterface $entity * The entity to be tested. * * @return bool * Returns TRUE if published; FALSE otherwise. */ public function isEntityPublished(EntityInterface $entity) { if ($entity->getEntityTypeId() === 'file' && $entity instanceof FileInterface) { return $entity->isPermanent(); } if (is_callable([$entity, 'isPublished'])) { return call_user_func([$entity, 'isPublished']); } return FALSE; }