Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
field system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Jun 2014 at 02:39 UTC
Updated:
29 Jul 2014 at 23:41 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
t0xicCode commentedComment #2
t0xicCode commentedComment #3
jhodgdonI think this is correct. Thanks! But it is scary that the tests passed without this. Wonder if preSave was tested for lists of items that had their own preSave methods? Apparently not... probably it needs a test?
Comment #4
t0xicCode commentedI'm unassign myself since I'm not too sure where to start with test writting.
Comment #5
lokapujyaWe have a test support module named "Field API Test". We could add a presave() to that and then somewhat copy the testDeterminingChanges() in NodeSaveTest. While looking into this, I also noticed that the "Node module tests" support module uses hooks. I wonder if it should be rerolled to override the FieldItemInterface methods (and if we extend the field support module in the same way, that it should use the interface too.
Comment #6
jhodgdonThe problem in this issue is that a method called "presave" is being called, not "preSave", on the field item class. So we need a plugin with a preSave() method, in order to test, and some way to verify that this method is called for each item in a list.
Comment #7
berdirmethod calls in PHP are case insensitive. It is impossible to test this because there's no functional bug here.
Comment #8
alexpottCommitted eb2bfe7 and pushed to 8.x. Thanks!