Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
typed data system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
27 Oct 2014 at 16:00 UTC
Updated:
19 Dec 2014 at 14:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
yched commentedPatch
Comment #2
yched commentedComment #3
andypostLooks great
Comment #4
alexpottThis issue is a normal task that intends to reduce fragility, and per #2350615: [policy, no patch] What changes can be accepted during the Drupal 8 beta phase?, we should discuss whether the benefit outweighs disruption. I would like to see a +1 from @fago or @berdir here as entity system maintainers (of which I assume typed data to be a part).
Personally I'm in favour of this issue because the discussions in #2221577: Fix assumption that field settings is not a nested array did reveal that this code is confusing.
Setting back to needs review to have said discussion.
Comment #5
yched commented@alexpott : I don't understand - this patch does not change the outside behavior of the method in any way.
Are we supposed to justify any internal code refactoring now ?
Comment #6
alexpott@yched yep - see #2350615: [policy, no patch] What changes can be accepted during the Drupal 8 beta phase? for the allowed changes. There's a really good flowchart that explains it.
Comment #7
yched commentedOK - well I guess the definition of an internal refactor is "disruption = 0", so the "impact > disruption" criteria should be manageable :-)
Comment #8
berdirI have to defer to @fago on this, he knows this part better and currently only have very limited core time, so I can't go into depth here.
But I see nothing with changing this in general.
Comment #9
yched commentedChanged Crypt::hashBase64() to crc32() for hashing the serialized settings, as per the discussion in #2346763: Improve views field rendering performance by caching entity display objects (see #10 & #13 over there)
Comment #10
yched commentedComment #11
andypost+1 to unify that kind of hashing
Comment #12
fagoIn general, +1 on the change. It makes the code clearer and easier to follow, but has no impact to the outside. Well unless people run into crc32 collisions now, but I think that's unlikely enough. ;-)
Here a review:
I cannot tell on which hashing algo to use, but looks like this has been discussed already. However, as it was something worth a discussion I think it also deserves a comment explaining our thinking.
The parenting information differs by clone and will be overwritting later by setContext() - thus it does not make sense to set it here. To avoid confusion it shoul be removed and rely on parenting info being set later.
Comment #13
fagoDiscussed 2. with yched on IRC. I wrongly assumed that the patch introduces the pass $object parameter, but it doesn't. Looking closer at it, we shoud keep it such that constructors have enough parenting information to setup objects. But as this is not obvious, let's have that documented here.
Comment #14
yched commentedShould adress #12 / #13
+ fixes a 80 chars wrapping issue in the previous patch.
Comment #15
yched commentedBump - @fago's remarks have been adressed, this just waiting for an RTBC.
Comment #16
amateescu commentedLooks great to me.
Comment #17
fagoNew comments are great, thanks. Agreed this is ready.
Comment #18
alexpottThis issue is a normal task so we need to outline how it fits within the allowable Drupal 8 beta criteria. Can someone add Drupal 8 beta phase evaluation template to the issue summary.
I think this internal refactoring is justified given the complexity of the code and moving to the consistent hashing for non cryptographic purposes makes sense too.
Comment #19
yched commentedTable added
Comment #20
alexpottThis patch makes this easier to maintain, consistent with other non cryptographic hashing and less fragile. Committed f503eb9 and pushed to 8.0.x. Thanks!
Thanks for adding the beta evaluation for to the issue summary.