Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
field system
Priority:
Critical
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
26 Nov 2013 at 17:05 UTC
Updated:
29 Jul 2014 at 23:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
fagoRelated: #1740492: Implement a default entity views data handler
Comment #2
fagoRelated: #2144327-6: Make all field types provide a schema()
Comment #3
tim.plunkettDemoting for now, it doesn't seem like this has really come up since filing this.
Comment #4
fagoThis is needed for #1498720: [meta] Make the entity storage system handle changes in the entity and field schema definitions - this qualifies it even as beta-blocker now. I'll roll a patch.
Comment #5
fagoHere it is.
Comment #6
plachLooks good.
I guess we should mark all revisionable fields out there as such now :)
Comment #7
plachComment #8
tstoecklerWhy is this TRUE by default? Is there any reason? I checked and isTranslatable() simply does !empty($this->definition['translatable'])
This should be return $this now.
Comment #10
fagoHere is a re-roll according our discussions. Not done yet (has a fail), and needs to incorporate definitions for all other content entities.
Comment #11
giorgio79 commentedThis key perhaps could even be used to avoid creating revision tables with dupe data in D8. This was quite an issue in d7 (https://drupal.org/project/field_sql_norevisions)
Comment #12
xjmComment #13
yched commentedNitpick:
Since "revisionability" check is made on the hardcoded 'label' entity key, similarly the "translatability" check could be made with an in_array() on an inlined, hardcoded list of keys. No need for the $untranslatable_keys var above, it feels disconnected with the comment that precedes its definition and hinders readability IMO.
Other than that: don't we want to default to TRUE ?
Comment #14
fagook, moved to in_array(). It's not as efficient, but its minor and the result is cached anyway.
Attached patch should fix the tests. Unfortunately I had to remove the nice simple little check to ensure all entity keys are there as well, but this would require us to redo most of entitymanager unit test. So removed this for being able to move on here.
That was my initial suggestion (see above), but after some discussion with berdir, tstoeckler and xano we agreed to default to FALSE. You either have to disable it for entity-key-fields manually, or you have to enable it for most others manually if it should be explicit. So it does not matter much but with the default of FALSE it's at least consistent with translatability.
Comment #15
fagoComment #16
plachComment #18
plachLooks good to me, would it make sense to add a (qualified) @todo about restoring the exception and refactoring EntityManagerTests as needed?
Comment #19
tstoecklerGreat! Have nothing to complain about. I agree with #14. I would find it unintuitive to have to ->setRevisionable(FALSE) for stuff like nid, etc.
@yched, you can obviously downgrade if you object, but marking this RTBC.
Comment #20
tstoecklerOops, crossposted with #18. Leaving at RTBC?!
Comment #21
plachYep, let's leave the decision to a committer.
Comment #23
webchickCommitted and pushed to 8.x. Thanks!
Comment #24
plach@fago:
Comment #25
plachComment #26
plachWorking on this
Comment #27
plach@fago is going to post a novice critical beta-blocker follow-up :)
Comment #28
fagoCreated #2225699: Set all revisionable fields to revisionable as follow-up.
FYI: Related issue for isRevisionable() on entity types: #2224549: Simplify checking whether an entity type is revisionable