- 🇺🇸United States SocialNicheGuru
Conflicts with 🐛 Cannot use relationship for rendered entity on Views Fixed . Just posting to save others time as that has been committed to 10.1.
- 🇺🇸United States smustgrave
Closed 🐛 [regression] getEntity() doesn't always return entity, which results in add comment field not working in Views Closed: duplicate as a duplicate
- 🇪🇸Spain akalam
I can confirm patch on #144 fixed the issue for me on Drupal 9.4.x
- @acbramley opened merge request.
- Status changed to Needs review
over 1 year ago 10:55pm 23 February 2023 - 🇦🇺Australia acbramley
So in terms of logging, I'm not entirely sure where this is best placed. Putting it in
FieldPluginBase::getEntity
would make sense but it would have to be a very generic message since we don't have context of what the entity id or type is there.I think the only place we can really add it is where
_entity
is set which looks like is inSql::assignEntitiesToResult
. That would mean adding a new dependency on the logger service and that would mean we'd need a deprecation dance for any classes extending that plugin.Before I go down that route, it would be good to get confirmation from @catch and/or @Berdir that this sounds like the right approach.
- 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
FieldPluginBase::getEntity has the following available
$this->configuration['entity_type']
for the entity-type$this->configuration['entity field']
for the field name$values->index
for the row index$this->view->id()
for the view machine name
so in theory we could use that information to construct a reasonably informative log message
- Status changed to Needs work
over 1 year ago 10:34am 24 February 2023 - Status changed to Needs review
over 1 year ago 11:17pm 26 February 2023 - 🇦🇺Australia acbramley
Logging added. Almost all tests needed updating to mock the logger factory so I've added a trait for that. Also removed the tearDowns which were unsetting the container as that happens in UnitTestCase::setUp anyway.
Almost certain there will be changes needed to the wording but this gets us into that convo :)
- Status changed to RTBC
over 1 year ago 6:17pm 27 February 2023 - 🇮🇳India rckstr_rohan
tested the MR !3529 , worked fell, all senerio covered, moving to RTBC done
- Status changed to Needs work
over 1 year ago 6:30am 20 March 2023 - 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
As this is a bug, can we also get a 9.5.x version? Thanks - it doesn't apply cleanly to 9.5.x.
- Status changed to Needs review
over 1 year ago 9:50pm 20 March 2023 - Status changed to RTBC
over 1 year ago 11:55pm 20 March 2023 - 🇺🇸United States smustgrave
Moving back to RTBC.
Compared patch #164 has all the changes in MR 3529 and they are all there except the change to phpstan-baseline.neon, (because it's not in 9.5)
- Status changed to Needs work
over 1 year ago 5:33am 24 March 2023 The Needs Review Queue Bot → tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide → to find step-by-step guides for working with issues.
- Status changed to RTBC
over 1 year ago 2:33am 25 March 2023 - 🇺🇸United States smustgrave
Moving back to RTBC. Think the bot tried to apply the 9.5.x branch to 10.1.x
- Status changed to Needs review
over 1 year ago 4:47am 28 March 2023 - First commit to issue fork.
- Status changed to Needs work
over 1 year ago 5:20pm 28 March 2023 - Assigned to acbramley
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 10:07pm 28 March 2023 - 🇮🇳India rckstr_rohan
The failing tests are related to the Drupal\FunctionalJavascriptTests\Tests\JSWebAssertTest class, specifically to the testJsWebAssert method. The error message suggests that there was a problem with the WebDriver, specifically with a stale element reference. This could be caused by the web page changing before the test could complete, or by an error in the test script itself.
- Status changed to Needs work
over 1 year ago 5:35am 29 March 2023 - 🇮🇳India rckstr_rohan
To correct this issue, the code for the JSWebAssertTest class needs to be reviewed and corrected. It is likely that the testJsWebAssert method needs to be updated to account for changes in the web page during testing. Additionally, the WebDriver configuration may need to be updated to ensure that it is properly interacting with the web page
- Status changed to Needs review
over 1 year ago 6:02am 29 March 2023 - 🇦🇺Australia dpi Perth, Australia
These ChatGPT answers are not helpful.
How is it relevant to this issue?
- Status changed to Needs work
over 1 year ago 7:53pm 1 April 2023 - 🇺🇸United States smustgrave
There still appear to be some open threads in the MR. Know you probably can't resolve them but could you leave a comment on them saying if they've been addressed or not needed.
- Status changed to Needs review
over 1 year ago 11:42pm 2 April 2023 - 🇦🇺Australia acbramley
Weird, I thought I had applied all suggestions in the last push but I seem to have missed 5 of them...all applied now.
- Status changed to RTBC
over 1 year ago 5:27am 3 April 2023 - 🇦🇺Australia mstrelan
Have reviewed the MR and all feedback has been addressed with tests passing. API additions mentioned in the Issue Summary don't need a Change Record. This is good to go.
-
larowlan →
committed 7ea52649 on 10.1.x
Issue #3007424 by acbramley, Spokje, mbovan, narendra.rajwar27,...
-
larowlan →
committed 7ea52649 on 10.1.x
- Status changed to Downport
over 1 year ago 4:42am 4 April 2023 - 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
Committed to 10.1.x
Although there is a minor API change here (returning null instead of a Url) at present that code just blows up with a WSOD so I don't think this is disruptive (its a WSOD out of your hands now, it would be something you can do something about with this patch). So on that basis I think this is worth considering for 10.0.x and 9.5.x but I will get a second opinion.
Setting as patch to be ported in the meantime.
- 🇨🇭Switzerland berdir Switzerland
This is causing test fails in TMGMT :-/
I have a custom entity label field plugin there: \Drupal\tmgmt\Plugin\views\field\EntityLabel, this displays the label of an entity, and it's on an optional relationship (messages that might or might not have a reference to a job item).
Not only does this now log errors in a situation that is not unexpected, the logging also blindly asumes that there is an entity field in the configuration, which I think isn't necessary. It might be due to very old default views configuration but still, it shouldn't cause php warnings on this:
Warning: Undefined array key "entity field"
Drupal\views\Plugin\views\field\FieldPluginBase->getEntity()() (Line: 438)I can work around it by checking if I have an ID, but http://grep.xnddx.ru/search?text=$this-%3EgetEntity($values) finds a bunch of similar use cases. I think what this should do is check for optional relationships and not log an error then.
-
larowlan →
committed 40b09f3b on 10.1.x
Revert "Issue #3007424 by acbramley, Spokje, mbovan, narendra.rajwar27,...
-
larowlan →
committed 40b09f3b on 10.1.x
- Status changed to Needs work
over 1 year ago 10:21pm 4 April 2023 - Assigned to acbramley
- Status changed to Needs review
over 1 year ago 11:01pm 4 April 2023 - 🇦🇺Australia acbramley
Was a bit tricky to figure out how to reproduce the failure but I was able to by:
- Checking out this branch on core
- Cloning tmgmt module
- Reverting https://git.drupalcode.org/project/tmgmt/-/commit/aab4b531f7cd60bbb5e25e...
- Running
phpunit app/modules/contrib/tmgmt/translators/tmgmt_local/tests/src/Functional/LocalTranslatorTest.php --filter testBasicWorkflow
- Which failed with
Warning: Undefined array key "entity field" Drupal\views\Plugin\views\field\FieldPluginBase->getEntity()() (Line: 438)
I then applied a fix (latest commit on the MR) and ran the tests again and they passed.
It seems like we don't have any tests in core that have an optional relationship with an entity that doesn't load, otherwise that would've triggered the same error? If anyone has pointers on where to put a test like that, that'd be great.
- 🇦🇺Australia acbramley
Test pushed. It's pretty gross but does the job. Using a mock logger to save having to install dblog and query for logs.
- 🇨🇭Switzerland berdir Switzerland
The change looks good I think, didn't check the test. One part that's not covered yet is handling the case if there's no entity field configuration key, I think that's a valid situation.
- Status changed to RTBC
over 1 year ago 3:39pm 6 April 2023 - 🇺🇸United States smustgrave
Last commit seems to cover #188.
Question is it possible on TMGMT to run tests with this as a patch? Not sure if that's possible in drupalci
- Status changed to Needs review
over 1 year ago 9:05pm 10 April 2023 - Status changed to RTBC
over 1 year ago 6:30pm 12 April 2023 - 🇺🇸United States smustgrave
Remarking for committer review
core/modules/views/src/Plugin/views/field/FieldPluginBase.php
The thread for this do we want to open a follow up?
- Status changed to Needs work
over 1 year ago 9:40am 13 April 2023 - 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
The thread in the MR has some suggestions now
- Status changed to Needs review
over 1 year ago 10:34pm 13 April 2023 - Status changed to RTBC
over 1 year ago 1:49pm 14 April 2023 - 🇺🇸United States smustgrave
Marking this for @acbramley. Checked the threads have been resolved and recommended change for $this->label() ?: $this->realField was added.
- last update
over 1 year ago 29,216 pass - last update
over 1 year ago 29,297 pass 57:41 52:08 Running- Open on Drupal.org →Environment: PHP 8.1 & MySQL 5.7last update
over 1 year ago Not currently mergeable. - 🇺🇸United States SocialNicheGuru
This applies and works.
I am placing this note here. It conflicts with 🐛 Cannot use relationship for rendered entity on Views Fixed on Drupal 9.5, which has been added to Drupal 10.1.
- Open on Drupal.org →Environment: PHP 8.1 & MySQL 5.7last update
over 1 year ago Not currently mergeable. - Status changed to Needs work
over 1 year ago 9:30pm 24 April 2023 - 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
Unfortunately, this now needs a reroll, clash in phpstan-baseline.neon
Fine to self RTBC on resolution
- last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago 29,314 pass - Status changed to RTBC
over 1 year ago 11:19pm 25 April 2023 -
larowlan →
committed 6af88f6d on 10.1.x
Issue #3007424 by acbramley, Spokje, mbovan, narendra.rajwar27,...
-
larowlan →
committed 6af88f6d on 10.1.x
- Status changed to Downport
over 1 year ago 10:05pm 26 April 2023 - 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
Committed to 10.1.x, moving to 10.0.x for backport
Thanks all 🎉
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 12:02am 27 April 2023 - last update
over 1 year ago 28,511 pass - Status changed to RTBC
over 1 year ago 3:46am 30 April 2023 - last update
over 1 year ago 28,511 pass - last update
over 1 year ago 28,511 pass - last update
over 1 year ago 28,514 pass -
larowlan →
committed 3cf6940d on 10.0.x
Issue #3007424 by acbramley, Spokje, mbovan, narendra.rajwar27,...
-
larowlan →
committed 3cf6940d on 10.0.x
- Status changed to Downport
over 1 year ago 11:25pm 5 May 2023 - 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
Committed to 10.0.x, moving to 9.5.x for reroll for that
- Status changed to Needs review
over 1 year ago 4:58pm 22 May 2023 - last update
over 1 year ago Custom Commands Failed - Status changed to Needs work
over 1 year ago 6:08pm 22 May 2023 - Status changed to Needs review
over 1 year ago 6:22am 23 May 2023 - last update
over 1 year ago 30,348 pass - Status changed to RTBC
over 1 year ago 10:38pm 24 May 2023 - last update
over 1 year ago 30,348 pass - last update
over 1 year ago 30,349 pass - last update
over 1 year ago 30,349 pass - last update
over 1 year ago 30,349 pass - last update
over 1 year ago 30,349 pass - last update
over 1 year ago 30,349 pass - last update
over 1 year ago 30,349 pass - last update
over 1 year ago 30,352 pass - last update
over 1 year ago 30,352 pass - last update
over 1 year ago 30,352 pass - last update
over 1 year ago 30,355 pass - last update
over 1 year ago 30,355 pass - last update
over 1 year ago 30,355 pass - last update
over 1 year ago 30,355 pass - last update
over 1 year ago 30,355 pass - last update
over 1 year ago 30,355 pass - Status changed to Fixed
over 1 year ago 8:04pm 26 June 2023 - 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
At this point, 9.5 is effectively security only.
There are a few commits in HEAD so there may be a bonus bugfix release, but we're not actively backporting any more issues at this point.Thanks everyone.
Automatically closed - issue fixed for 2 weeks with no activity.