Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Comment | File | Size | Author |
---|---|---|---|
#28 | 2687075-28.patch | 4.17 KB | andypost |
| |||
#15 | 2687075-14-test-only.patch | 1.42 KB | andypost |
Comment | File | Size | Author |
---|---|---|---|
#28 | 2687075-28.patch | 4.17 KB | andypost |
| |||
#15 | 2687075-14-test-only.patch | 1.42 KB | andypost |
Comments
Comment #2
gaydabura CreditAttribution: gaydabura as a volunteer and at Skilld commentedTemporary solution.
Also we remove term itself from "parent" to prevent recursion
Comment #3
gaydabura CreditAttribution: gaydabura as a volunteer and at Skilld commentedComment #4
andypostPlease describe steps to reproduce to write tests
that needs inline comment Why
Comment #5
gaydabura CreditAttribution: gaydabura as a volunteer and at Skilld commentedTo reproduce:
1. Create vocabulary
2. Add terms with hierarchy
3. Export terms
4. Try to import terms
No hierarchy.
Comment #7
gaydabura CreditAttribution: gaydabura as a volunteer and at Skilld commented+ unset($parents[$entity->id()]);
This needed to avoid recursion when term depends on itself. For some reason loadAllParents add term itself to tree.
Comment #8
gaydabura CreditAttribution: gaydabura as a volunteer and at Skilld commentedComment #9
larowlanThis is the wrong fix - we need a new normalizer like EntityPilot has - see http://cgit.drupalcode.org/entity_pilot/tree/src/Normalizer/TermEntityNo... and http://cgit.drupalcode.org/entity_pilot/tree/src/EntityPilotServiceProvi...
Comment #10
larowlanComment #11
andypostHere it is, still needs tests
Comment #12
jibranGiven that this is the same normalizer we have in entity pilot. I think we should add this normalizer to core.
Comment #13
andyposttrying to write tests
no need for core, just need to fix #2543726: Make $term->parent behave like any other entity reference field, to fix REST and Migrate support and de-customize its Views integration
Comment #14
jibranThis is an alter function so we should move this service definition to yml file. Do we really need module exist check for taxonomy?
Comment #15
andypostHere's a test
Comment #17
andypost@jibran suppose we have to check for module enable, otherwise default content module should set dependency
Comment #18
jibranOk that's fine so why not use
DefaultContentServiceProvider::register()
instead.Comment #19
andypostpersonally because there's alter already
Comment #20
Sam152 CreditAttribution: Sam152 at PreviousNext commentedFYI, I created a sandbox called 'Better Normalizers ', https://www.drupal.org/sandbox/sam/2705067. The intention being, sharing this code between modules. Maybe copying them is easiest if they are likely to vary between these modules anyway, but it was required for aGov because we needed the file_entity normalizers but didn't want a dependency on file_entity itself.
Comment #21
sqndr CreditAttribution: sqndr at Randstad Digital commentedIs there a way to manually at the parent to the json file? I'm still not able to export the parent for taxonomy terms …
Comment #23
larowlanComment #24
larowlanComment #25
aleevasRerolled last patch.
Comment #27
andypostthis part missed in reroll
Comment #28
andypostService provider gone, so patch restores
Tests needs review cos old ones are refactored
Comment #29
larowlanI think this is ready too, will commit on Monday if still RTBC
Comment #30
Dane Powell CreditAttribution: Dane Powell at Acquia commentedPatch #28 worked for me. Thanks.
Comment #31
Dane Powell CreditAttribution: Dane Powell at Acquia commentedNote that I just filed #2796791: Recursive reference export, which might be a problem specific to this patch or something more general.
Comment #32
Hydra CreditAttribution: Hydra at erdfisch commented#28 Still working for me :) THx!
Comment #34
larowlanFixed, thanks!
Comment #36
jibran