Page field in Concrete 9.1 & PHP 8.1 returns the value bool(false) in its view.php
Permalink Browser Info Environment
In PHP 8.1 and concrete 9.1, Page field always returns false at its block's view.php
Not only as a single field but also occurred under repeatable.
The value of the page filed (cID) is correctly saved in the database. Page selector and setting the value won't have any problems at form.php.
I have tried to get the page field value at view.php but it always returns bool(false).
If I run the block conf files under php 7.4 and Concrete 9.1, the page filed returns its page collection value correctly.
It seems that this problem occurs depending on PHP version. My test config.php for this bug is here.
return [
// Block
'block' => [
'name' => t('Test'),
'description' => t('Created with Block Developer'),
],
// Fields
'fields' => [
'page_one' => [
"type" => "Page",
"label" => "select",
],
"entry"=>[
"type" => "Repeatable",
"label" => "tests",
"searchable" => true,
"config" => [
"add_label" => "Add",
"fields" => [
"page"=>[
"type" => "Page",
"label" => "select",
],
"title" => [
"type" => "Text",
"label" => "title",
"required" => false,
],
"image" => [
"type" => "File",
"label" => "image",
"required" => false,
],
]
]
]
],
];
I purchased this block for production. I hope this bug is patched as soon as possible.
Not only as a single field but also occurred under repeatable.
The value of the page filed (cID) is correctly saved in the database. Page selector and setting the value won't have any problems at form.php.
I have tried to get the page field value at view.php but it always returns bool(false).
If I run the block conf files under php 7.4 and Concrete 9.1, the page filed returns its page collection value correctly.
It seems that this problem occurs depending on PHP version. My test config.php for this bug is here.
return [
// Block
'block' => [
'name' => t('Test'),
'description' => t('Created with Block Developer'),
],
// Fields
'fields' => [
'page_one' => [
"type" => "Page",
"label" => "select",
],
"entry"=>[
"type" => "Repeatable",
"label" => "tests",
"searchable" => true,
"config" => [
"add_label" => "Add",
"fields" => [
"page"=>[
"type" => "Page",
"label" => "select",
],
"title" => [
"type" => "Text",
"label" => "title",
"required" => false,
],
"image" => [
"type" => "File",
"label" => "image",
"required" => false,
],
]
]
]
],
];
I purchased this block for production. I hope this bug is patched as soon as possible.
Type: | Ticket |
---|---|
Status: | Resolved |
Upgrading to 1.4.2 from 1.4.1, this problem has been solved.