Closed (fixed)
Project:
Dynamic Entity Reference
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
29 Oct 2014 at 04:35 UTC
Updated:
25 Jan 2015 at 13:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
jibranComment #2
jibran#2232477: Fatal when adding new fields with NOT NULL constraints in a base table that contains existing entities is also making changes in
EntityReferenceItemComment #3
jibranAdded my changes based on #2232477: Fatal when adding new fields with NOT NULL constraints in a base table that contains existing entities.
Comment #5
larowlanLooking good - do you want help with the fails?
Comment #6
jibranNo it will be green once #2232477: Fatal when adding new fields with NOT NULL constraints in a base table that contains existing entities is in.
Comment #7
jibranAlso related #2363099: Using translated field definition descriptions in entity schema results in different schema definitions, resulting in update.php changes
Comment #8
jibranMore related issues #2386559: ERItem::setValue(array('entity' => $entity) produces broken Items and #2137309: Typed data does not handle set() and onChange() consistently
Comment #9
jibran#2137309: Typed data does not handle set() and onChange() consistently is in and it has broken HEAD and I have no idea how to fix this. Here is some more work.
DynamicEntityReferenceis now exactly same asEntityReference:/Comment #11
larowlanThis change seems to be part of the problem, it breaks auto-creation of tags. I don't see a corresponding change in ER field - what was the reasoning?
Can't afford to spend anymore time on this today - damn typed data.
Comment #13
larowlanThe issue is that the constraint gets out-of-whack - its trying to validate a different entity-type (not a user).
I wonder if our 'fake it' stuff is the issue here - overriding the entity-type somewhere too low, or somewhere we're missing where we need to force it - in the validation API.
Comment #14
jibranThis change is due to #2232477: Fatal when adding new fields with NOT NULL constraints in a base table that contains existing entities. We are only using content entities unlike ER so our taget_id will always be integer. If and when we plan to support config entities then we can update it to support strings.
I have seen the error in #13 and thanks for the idea I'll try to investigate more.
Comment #15
larowlanHappy to keep it as string, but the setRequired(TRUE) is incompatible with auto-create
Comment #16
jibranI am doing
setRequired(TRUE)because of #2232477: Fatal when adding new fields with NOT NULL constraints in a base table that contains existing entities. Is there a reason why we want to keep it a string? We are only supporting entities which are implementingFieldableEntityInterfaceso making it integer make sense to me unless you have some other reason.DER field can only support either content entities or config entities per field. In the future we can add a field storage option to choose between content entities or config entities and then we can update DERI::propertyDefinitions() and DERI::schema() same as ERI::propertyDefinitions() and ERI::schema() to support both content entities and config entities.
Comment #17
jibranFixes after #2386559: ERItem::setValue(array('entity' => $entity) produces broken Items and #1963340: Change field UI so that adding a field is a separate task haven't fixed #13. This patch is rerolled over #2232477-134: Fatal when adding new fields with NOT NULL constraints in a base table that contains existing entities
Comment #18
jibranI have added individual commits for all the above fixed issues so that we can deal with the problem in hand here is the reroll version of the patch.
Comment #19
larowlanNo bot?
Comment #22
jibranBot is back. This should be green.
Comment #24
jibranPostponing it on #2232477: Fatal when adding new fields with NOT NULL constraints in a base table that contains existing entities
Comment #27
jibranFixed the fails, updated the patch according to #2232477: Fatal when adding new fields with NOT NULL constraints in a base table that contains existing entities committed version, have done some clean up and added some docs so that we'll get less confuse next time ;-).
Comment #28
jibranWe can add this constraint in setValue(). Do you think it is worth it? If yes we can discuss this in follow up.
Comment #29
larowlanmaybe we should call this $entity_property so it's clear?
Other than that, looks awesome - thanks again
Comment #31
jibranFixed on commit. Thanks for the review and support.
Comment #32
jibranAdded #2405467: Add EntityType and Bundle constraint on entity property of DynamicEntityReferenceItem for #28