First of all, great work on the first work version, it works pretty nice already!

However, there's an annoying caveat and that's the field definition of items_target_id.

I currently have a setup where I have one queue referencing content, and another queue (with 6 subqueues) which should be able to reference block. However, their id's are uuids, so when trying to save, the storage goes boom. The quick fix was to manually change the column to a varchar and then everything was fine.

Now, I haven't tested this, and didn't look into the details when the field is made, but in case I would have done the setup the other way around (so first reference a block, and then another queue referencing content), maybe the field would have been a string already, but not sure.

Not sure what the best solution would be here:
- a different entity reference item field per queue ?
- or maybe entity queue should provide a field extending on EntityReferenceItem so that propertyDefinitions always creates a string items_target_id field ?

CommentFileSizeAuthor
#4 2634154.patch929 bytesamateescu

Comments

swentel created an issue. See original summary.

swentel’s picture

Issue summary: View changes
swentel’s picture

Issue summary: View changes
amateescu’s picture

Priority: Normal » Major
Status: Active » Fixed
StatusFileSize
new929 bytes

It's not really necessary to provide our own special entity reference field, we can just default to a target entity type that uses string IDs in EntitySubqueue::baseFieldDefinitions() and this will force the entity storage initialization to use a string type for the 'target_id' column :)

And just as a reference note for existing D8 sites that already have this problem: you can just change the column type manually from int to varchar(255) for the items_target_id column in the entity_subqueue__items table.

  • amateescu committed 9b9559b on 8.x-1.x
    Issue #2634154: items_target_id in entity_subqueue__items should not be...

  • amateescu committed 2373339 on 8.x-1.x
    Follow-up to issue #2634154: items_target_id in entity_subqueue__items...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.