Closed (fixed)
Project:
Drupal core
Version:
8.1.x-dev
Component:
field system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
31 Dec 2015 at 06:06 UTC
Updated:
14 Apr 2016 at 13:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
hussainwebThe patch fixes the issue.
Comment #3
hussainwebComment #4
hussainwebJust a very rough test. This should fail. I will then write a proper test for both file and image widgets.
Comment #5
hussainwebThis should do it (hopefully).
Comment #6
swentel commentedThis will fail - moving to field system as well as it's not really a token problem, but rather a widget(base) problem.
Comment #7
swentel commentedAnd with fix - we'll need additional tests for the file field widget too to make sure that it works there (since I changed code in FileWidget too).
Comment #9
berdirWhat about a helper method on WidgetBase for this? getFilteredDescription() or something like that?
Comment #10
hussainwebThat sounds useful, however, I don't think we can do that for 8.0.x. If we agree on the method, we could create a follow-up for 8.1.x.
Comment #11
swentel commentedWidgetBase is abstract, so I think that's totally fine todo for 8.0.x even.
Comment #12
swentel commentedreroll + new method
Comment #13
berdirI think we still require a description for @return, even if it is as simple as this?
Comment #14
swentel commentedYeah, lazy me :)
Comment #15
berdirGreat. Lets get this fixed.
Comment #17
catchAdding the protected method to the base class is something we can't do in a patch release.
Not 100% sure for a minor release either - for me I'd make the change but be prepared to roll back before tagging a stable release if it turns out someone added a method to a subclass with the same name. Pinged alexpott for a second opinion.
Once this is in 8.1.x it's backportable to 8.0.x without the protected method, or possibly with an underscore prefix and @internal note.
Comment #18
catchTalked to @xjm to confirm we're on the same page.
While we treat base classes as @api, adding a method to a base class is not an API change. It could theoretically break someone's code somewhere, but that's what minors are for.
If we do break someone's code before a release candidate, they can file a bug report and we can talk about it. Otherwise it's just an improvement for everyone else anyway.
However, it's an API addition to the base class, so we should add a change notice.
Comment #19
catchHere it is:
https://www.drupal.org/node/2668850
Patch didn't apply to 8.1.x due to entity_create() conversion, so re-rolled.
Comment #20
mohit_aghera commentedTested #19 on local.
Screenshots are attached. Seems working fine for me.
Comment #21
heykarthikwithuTested #19
+1 RTBC
Comment #23
catchI only did a straight re-roll so I think I'm OK to commit this to 8.1.x
For 8.0.x we either need to skip the change to the base class and inline that code, or make it _underscorePrefixed() and @internal with a note that it'll change in 8.1.x.
I'm marking this fixed against 8.1.x, if you want to work on a backport please re-open and move it to 8.0.x.
Comment #24
naveenvalechaThanks!
Published the CR https://www.drupal.org/node/2668850
Comment #25
berdirLets just go back to the patch from #7 then for the backport. No need to introduce this method here if it causes so many complications. Wasn't aware that we're so strict on that in 8.0.x.
Re-uploading that patch, didn't make any changes.
Comment #27
berdirDidn't apply anymore, rerolled.
Comment #28
swentel commentedComment #29
alexpottThe original patch seems to be missing test coverage.
At the very least we should be asserting for the expected text as well... $this->assertNoText() is very vulnerable to false positives.
Comment #30
xjmLet's go back to having this fixed against 8.1.x, since 8.0.x is about to be EOL. Let's open a followup for fixing the test coverage.
Also retroactively downgrading; the committers agreed this is not a major issue. Thanks!
Comment #31
xjm