- Issue created by @dragonfire353
- π³πΏNew Zealand janvonmulert
I am getting this error while trying to access layout builder for a content type that uses a scorm_field. Here is a patch for a simple null check before assigning the base_path property. The scorm field won't display properly in the layout builder preview, but at least it makes it possible to access layout builder.
- πΊπ¦Ukraine oleksandr.s
Hi, I added a fix for this issue by fixing
ScormFieldScorFormatter
class.In my case, error happen when use
scorm_field
with combination of paragraph and used a Layout Paragraphs widget for such paragraph field.
With such combination node object can't be fetched from route, because route islayout_paragraphs.builder.insert
- Merge request !5Change scorm_field_scorm_formatter to fix error. Add dependency injections β (Closed) created by Unnamed author
- Merge request !6Change scorm_field_scorm_formatter to fix error. Add dependency injections β (Open) created by Unnamed author
- πΊπ¦Ukraine oleksandr.s
oleksandr.s β changed the visibility of the branch 3441865-error-attempt-to to hidden.
- π¬π§United Kingdom globexplorer
Hi @oleksandr.s!
I think It would be better to remove the route match service at all. The node object can be retrieved from the fromatter ->getEntity() method itself.
see here:
// Read the entity id from url $node = $items->getEntity(); if ($node instanceof NodeInterface) { $nid = $node->id(); }
- Status changed to Needs review
about 2 months ago 1:23pm 5 November 2024 - πΊπ¦Ukraine oleksandr.s
hi @globexplorer
I would not use `$node = $items->getEnitity();` because with such code entity of another can be fetched, not only entity of `node` type.
For example, when Layout Paragraph used then `$items->getEnitity();` will fetch `paragraph` entity.
Please check `$e` variable on sreenshot.
- π¬π§United Kingdom globexplorer
Thanks @oleksandr.s! The problem here is, that the scorm field in that version can only be attached to entities of type node. We have to change some other bits in code and in database table to address this properly. The code change here would be not enough. Furthermore using layout builder with no node in route would that not be the logical next problem. Once we addressed all relying issues I will credit you for that issue.