- Issue created by @Tom Grootjans
- last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago Custom Commands Failed - Status changed to Needs work
over 1 year ago 12:21pm 21 June 2023 - ๐ง๐ชBelgium borisson_ Mechelen, ๐ง๐ช
Looks like this means we can update the phpstan baseline file as well
- ๐ง๐ชBelgium borisson_ Mechelen, ๐ง๐ช
I wonder why this wasn't caught by the rest of the test coverage. Does this signal missing coverage as well?
These are existing exceptions in PHPStan. If you fix them you have to remove the exceptions from the baseline file.
- First commit to issue fork.
- ๐บ๐ธUnited States mile23 Seattle, WA
I'm seeing this in Drupal 10.1.8 and PHP 8.2.13, running tests on my project, thanks to symfony/phpunit-bridge.
5x: Creation of dynamic property Drupal\Core\TypedData\TypedData@anonymous::$value is deprecated 5x in OURTEST::test from OUR\CLASS
(The @anonymous is because our use-case is weird... :-))
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...
- ๐บ๐ธUnited States mile23 Seattle, WA
1) Derp... the ignore file is
core/.deprecation-ignore.txt
2) Re: #4: Yes, I think this signals a coverage issue, because there's no ignore regex related to dynamic properties in any of the branches 10.0.x to 11.x.
- ๐ฎ๐ณIndia nagender16
This 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
As 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
- ๐จ๐ฆCanada aarantes
Hi,
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:
The website encountered an unexpected error. Try again later. InvalidArgumentException: The state '' does not exist in workflow. in Drupal\workflows\Plugin\WorkflowTypeBase->getState() (line 155 of core/modules/workflows/src/Plugin/WorkflowTypeBase.php). Drupal\content_moderation\Plugin\WorkflowType\ContentModeration->getState(NULL) (Line: 366) Drupal\content_moderation\EntityTypeInfo->formAlter(Array, Object, 'node_program_intake_edit_form') (Line: 165) content_moderation_form_alter(Array, Object, 'node_program_intake_edit_form') (Line: 545) Drupal\Core\Extension\ModuleHandler->alter('form', Array, Object, 'node_program_intake_edit_form') (Line: 841) Drupal\Core\Form\FormBuilder->prepareForm('node_program_intake_edit_form', Array, Object) (Line: 284) Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73) Drupal\Core\Controller\FormController->getContentResult(Object, Object) call_user_func_array(Array, Array) (Line: 123) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 627) Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58) Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48) Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28) Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 32) Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 106) Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85) Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 270) Drupal\shield\ShieldMiddleware->bypass(Object, 1, 1) (Line: 137) Drupal\shield\ShieldMiddleware->handle(Object, 1, 1) (Line: 48) Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51) Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36) Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51) Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704) Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
So, for the sake of trying something different, I made the patch local and tried to define
$value
as 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 8
When made it private I didn't get an error...
- ๐ฎ๐ณIndia smitghelani Surat, Gujarat
With 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,
- ๐ง๐ชBelgium BramDriesen Belgium ๐ง๐ช
- ๐จ๐ฆCanada Liam Morland Ontario, CA ๐จ๐ฆ
Liam Morland โ made their first commit to this issueโs fork.
- Merge request !7929Draft: Resolve #3368250 "Deprecated creation of" โ (Open) created by Liam Morland
- ๐จ๐ฆCanada Liam Morland Ontario, CA ๐จ๐ฆ
I 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 proper solution since it is really just hiding the problem.
- ๐จ๐ณChina changfengqj
thank 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).
- ๐ฎ๐ณIndia samit.310@gmail.com
samit.310@gmail.com โ made their first commit to this issueโs fork.
- Status changed to Needs review
5 months ago 12:04pm 24 July 2024 - ๐ง๐ชBelgium BramDriesen Belgium ๐ง๐ช
I highly doubt all those failing tests are relevant to the changes in the MR. Think we need to re-trigger them, but unsure how.
- ๐ง๐ชBelgium BramDriesen Belgium ๐ง๐ช
Ah, I needed push access, that's why I didn't see the replay button. Re-triggered the tests.
- Status changed to Needs work
5 months ago 2:40pm 24 July 2024 - ๐บ๐ธUnited States smustgrave
Seems all those tests are legit failures. Also left a small comment on the MR.
- ๐ง๐ชBelgium BramDriesen Belgium ๐ง๐ช
I don't see how this can cause MySQL errors, but ok :P
- ๐ง๐ชBelgium BramDriesen Belgium ๐ง๐ช
Test output looks pretty much identical.
- ๐ฎ๐ณIndia samit.310@gmail.com
Hi @smustgrave, @BramDriesen,
One issue, I found 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 address
is not getting saved. The mail column has the null value in DB for that newly created user.Thanks
Samit K.