Skip to content

File list doesn't work in Gutenberg editor #916

@michaelclaesson

Description

@michaelclaesson

When trying to add a file list (files module) to a Gutenberg page the system throws an error.

PHP Fatal error: Uncaught TypeError: AcfService\Implementations\NativeAcfService::getField(): Argument #2 ($postId) must be of type string|int|false, null given, called in /wp-content/plugins/modularity/source/php/Module/FilesList/FilesList.php on line 58 and defined in /wp-content/plugins/modularity/vendor/helsingborg-stad/acfservice/src/Implementations/NativeAcfService.php:16

Problem seems to come from the fact that the module gets its data from a post ID and when the block is used in Gutenberg the data is "inline" so no post ID is needed.

https://github.com/helsingborg-stad/Modularity/blob/main/source/php/Module/FilesList/FilesList.php#L58

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions