Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
entity system
Priority:
Critical
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
23 May 2013 at 22:03 UTC
Updated:
29 Jul 2014 at 22:22 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
berdirTagging.
Comment #2
eugene.ilyin commentedHello.
DrupalSib team (Russia, Novosibirsk) want to implements this on today code sprint.
Comment #3
eugene.ilyin commentedSorry.
We do not have time to solve this problem today. Anybody can take this task.
Comment #4
klausiFirst patch with test case - not much to validate here except for the term name?
Comment #6
klausiOK, converting the parent field to entity reference breaks a lot of things and is confusing, so that should be splitted out to a separate issue.
Comment #7
klausiOpened #2048555: Convert term parent to entity reference for the term parent reference conversion.
Comment #8
klausiOK, since the automated tests actually pass we can move the parent entity reference back in here and close #2048555: Convert term parent to entity reference as duplicate.
I opened #2049121: Regression: Moving out term children on term listing page is broken to deal with the problem I experienced during my manual testing, which is independent of this issue.
Comment #9
klausi#8: term-validation-2002168-8.patch queued for re-testing.
Comment #10
andypostRelated issue #2068287: Support bundle names provided in the request arguments in EntityCreateAccessCheck
Comment #11
moshe weitzman commentedI'm a little surprised to see a new attachLoad() method with no corresponding deletion. I thought this issue just moved around existing code?
Comment #12
berdirYeah, not too happy about front-loading the parents, we didn't do that for a reason. Also related is the issue that attempts to add methods to TermInterface.
I guess we'd rather have to make this a computed field, we already made terms slow enough...
Comment #13
klausiOk, so I implemented a custom field class for the term parent field that lazy loads the parents.
The tests will fail because the parent is a entity reference field and the validation should flag invalid references, but I have no idea why that does not work right now.
Comment #15
klausiIt all makes a lot more sense if the parent field is not computed, because we are just loading it on demand.
We could even add a generic abstract LazyLoadField to core, so that the taxonomy module would only have to implement one lazyLoad() method that returns the field values suitable for the setValues() method.
Comment #16
klausiDoes not apply anymore.
Comment #17
klausiRerolled. I also removed a @todo about integrating the description format with the description field, but that would require the creation of a TextFormattedItem (text_formatted_field) class to handle that, and that would be a bit too much for this issue. There is already a @todo in the code about that.
Comment #18
klausiPatch does not apply anymore rerolled. Also fixed a module dependency in the test.
Comment #19
klausi#18: term-validation-2002168-18.patch queued for re-testing.
Comment #21
klausiSo the class Field is now FieldItemList, fixed that.
Comment #22
effulgentsia commentedStraight reroll for HEAD changes. No changes to real lines of code.
Comment #25
effulgentsia commentedComment #26
effulgentsia commentedComment #28
effulgentsia commentedThe test failure is due to parent=0 being treated as an empty value and being filtered out before getting saved to {taxonomy_term_hierarchy}. There were other nasty hacks in the patch working around other difficulties in making parent into an ER field, so let's defer that to #2048555: Convert term parent to entity reference, and proceed with this, in order to move us closer to #2002180: Entity forms skip validation of fields that are edited without widgets.
Comment #29
jibranLooks good to me.
Comment #30
berdirThis should be possible now.
However, doing it here is only partially related to this issue, not sure. The @todo would have to be reworded at least.
As it's the bundle, wondering if that needs special validation (could be separate issue, for all entities with bundles) as it's basically read-only, you can't just change the bundle of an entity that has fields.
I think we reference the URL in code comments, not just the ID like this?
Comment #31
fagoPatch needs to be updated :/
Comment #32
effulgentsia commentedChild issue of #1696648: [META] Untie content entity validation from form validation, therefore critical.
Comment #33
klausiRerolled.
Comment #35
Github sync commentedA new pull request was opened by klausi for this issue.
Comment #36
fagoI think we should at least verify the bundle is there and exits, but that should be solved already by setting it to required and converting it to an ER.
Is this still the case? What's problematic about it? Could we put that all into a new issue so we can work on it there?
Please also see my comment @ [#8381407] about whether max_length on the string field makes sense?
Comment #37
Github sync commentedSome commits were pushed to the pull request.
Comment #38
klausiConverting the bundle field is a separate issue: #2181593: Convert entity bundle base fields to entity reference.
Converting the parent field is a separate issue: #1915056: Use entity reference for taxonomy parents.
Synced over the changes to StringItem.php from #2002158: Convert form validation of comments to entity validation.
Comment #41
Github sync commentedSome commits were pushed to the pull request.
Comment #42
chx commentedYou can't stop with this Github sync shit, can you? https://drupal.org/node/2172149 reopened, raised to critical.
Comment #43
andypostLooks RTBC except minor
I'd just suggest to wrap this in
if ($this->getFieldSetting('max_length'))see related #2150511: [meta] Deduplicate the set of available field typesComment #44
Github sync commentedklausi pushed some commits to the pull request.
Comment #45
klausi@andypost: sure, why not.
Interdiff: https://github.com/klausi/drupal/commit/75079dcf5b2c03d2206ceb07d23aa71a...
Comment #46
andypostSo I see no nitpicks and like to see this commited asap
Comment #47
catchCommitted/pushed to 8.x, thanks!