Needs work
Project:
Drupal core
Version:
main
Component:
typed data system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
21 Jun 2023 at 11:46 UTC
Updated:
12 Feb 2025 at 11:30 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
tom grootjansComment #3
borisson_Looks like this means we can update the phpstan baseline file as well
Comment #4
borisson_I wonder why this wasn't caught by the rest of the test coverage. Does this signal missing coverage as well?
Comment #5
cilefen commentedThese are existing exceptions in PHPStan. If you fix them you have to remove the exceptions from the baseline file.
Comment #7
mile23I'm seeing this in Drupal 10.1.8 and PHP 8.2.13, running tests on my project, thanks to symfony/phpunit-bridge.
(The @anonymous is because our use-case is weird... :-))
Also in just a generic usage:
I can't find any reference to 'dynamic property' in
core/phpstan-baseline.neon. Maybe I don't understand how it works or I have the wrong file.Apparently this issue will make things break in PHP 9.0. I'd add a PHP 9.0 tag but it doesn't seem to exist yet...
Comment #8
mile231) Derp... the ignore file is
core/.deprecation-ignore.txt2) Re: #4: Very strange... Here's a test: https://git.drupalcode.org/project/drupal/-/blob/11.x/core/tests/Drupal/... but there's no ignore regex related to dynamic properties in any of the branches 10.0.x to 11.x.
Comment #9
nagender16 commentedThis patch is producing below fatal error when applied for 10.2.2 with workflow enabled content edit page.
drupal10.typeddata-deprecated_dynamic_propert_3368250-1.patch
Uncaught PHP Exception InvalidArgumentException: "The state '' does not exist in workflow." ... web\core\modules\workflows\src\Plugin\WorkflowTypeBase.php line 155
Comment #10
ni.pineau@gmail.com commentedAs a temporary workaround, would it make sense to change web/core/lib/Drupal/Core/TypedData/TypedData.php this way (rather than adding value property which produces bug reported in #9) :public function getValue() {if (!isset($this->value)) {
return NULL;
}
return $this->value;}It seems to suppress the warning[EDIT] stupid proposal please ignore, I appologize
Try this patch instead
Comment #12
aarantes commentedHi,
I had a similar issue to nagender16 (#9)
When I applied the patch, I was not able to edit any entity of a content type that has a workflow associated to it.
The full error message I get is as follows:
So, for the sake of trying something different, I made the patch local and tried to define
$valueas public and private.When made public, I got this error:
Fatal error: Access level to Drupal\Core\TypedData\PrimitiveBase::$value must be public (as in class Drupal\Core\TypedData\TypedData) in /var/www/docroot/core/lib/Drupal/Core/TypedData/PrimitiveBase.php on line 8When made it private I didn't get an error...
Comment #13
smitghelani commentedWith Drupal 10.2.3 and PHP version 8.2. I am also getting the same issue while applying the patch mentioned in comment #2. So, for time being i am using this patch to avoid this deprecation error,
Comment #14
bramdriesenPatch #13 is not a correct fix and should imho not be used. This is just suppressing the warning. It will also only work as of PHP 8.0+. Version needs to be set to the current development branch and be back-ported if needed to lower versions.
#5 Still needs to be addressed in the MR.
Comment #17
liam morlandI have rebased the issue fork onto 11.x, addressed #5, and opened a merge request.
However, I am also seeing the issue described in #12 on Drupal 10.2.
The patch in #13 resolves the issue for me, though, like #14, I hesitate to call that the permanent solution since it is really just hiding the problem. This could be a temporary solution, perhaps just for Drupal 10, to allow sites to work on PHP 8.2 while a follow-up issue produces a permanent solution.
Comment #18
changfengqj commentedthank you to reply.
but after I patch this file, appear some wrong when save menu link .
Drupal\Core\Database\IntegrityConstraintViolationException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'id' cannot be null: UPDATE "menu_link_content_revision" SET "id"=:db_update_placeholder_0, "langcode"=:db_update_placeholder_1, "revision_user"=:db_update_placeholder_2, "revision_created"=:db_update_placeholder_3, "revision_log_message"=:db_update_placeholder_4, "revision_default"=:db_update_placeholder_5 WHERE "revision_id" = :db_condition_placeholder_0; Array ( [:db_update_placeholder_0] => [:db_update_placeholder_1] => en [:db_update_placeholder_2] => [:db_update_placeholder_3] => 1714985311 [:db_update_placeholder_4] => [:db_update_placeholder_5] => 1 [:db_condition_placeholder_0] => 1 ) in Drupal\mysql\Driver\Database\mysql\ExceptionHandler->handleExecutionException() (line 45 of /var/www/utstar_new/core/modules/mysql/src/Driver/Database/mysql/ExceptionHandler.php).Comment #20
bramdriesenI highly doubt all those failing tests are relevant to the changes in the MR. Think we need to re-trigger them, but unsure how.
Comment #21
bramdriesenAh, I needed push access, that's why I didn't see the replay button. Re-triggered the tests.
Comment #22
smustgrave commentedSeems all those tests are legit failures. Also left a small comment on the MR.
Comment #23
bramdriesenI don't see how this can cause MySQL errors, but ok :P
Comment #24
smustgrave commentedWhat happened when you reran them?
Comment #25
bramdriesenTest output looks pretty much identical.
Comment #26
samitk commentedHi @smustgrave, @BramDriesen,
One issue that i noticed, is that the user is not getting saved in edit mode, getting the error message '
Email field is required.', Also while saving the new user, user is getting created butEmail addressis not getting saved. The mail column has the null value in DB for that newly created user.Thanks
Samit K.
Comment #27
andypostComment #28
divya.lakshman commentedAfter applying Patch #13 I still see this on watchdog
I am on PHP8.3 and Drupal 10.4.1
Comment #29
randalv commentedWith the current MR changes, I run into a plethora of issues where the value is set to an empty array or null or something...
Not sure why this happens.
Causes issues on basically any entity form for me, for example when saving a new taxonomy term, then the 'weight' value is set to null and gives a WSOD.
Comment #30
niranjan_panem commentedChecked the tablefield module web page below link
https://www.drupal.org/project/tablefield/releases/3.0.0-beta1
has the patch from below issue link
https://www.drupal.org/i/3397688