Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
documentation
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
27 Sep 2012 at 10:54 UTC
Updated:
14 Mar 2014 at 16:40 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
jhodgdonYeah, that hook definitely needs some documentation love! It should have a function body and the parameters should definitely be explained. Thanks for the report!
Comment #2
larowlanTagging
Comment #3
deviantintegral commentedAs is, this hook is pretty difficult to use. None of the array keys needed for $errors are provided to the hook, so you have to call into the field info API to retrieve them. I've only ever seen this hook implemented twice, in relation_unique and in some custom code. For both of those modules, they were able to simplify the implementation since relations are by their definition not translatable and the field name is well-defined on the relation entity. For reference:
This hook probably needs attention for D8 so implementors don't need the boilerplate code. But for D7, I'm hesitant to roll a patch with the above since the field name might not be fixed and the field might be translatable.
Comment #4
Noe_ commentedAre you guys sure hook_field_attach_validate() still exists in D8?
Because I cannot find it anywhere in the code.
Comment #5
clemens.tolboomSee
#1874300: Remove $entity_type argument from field.module functions that receive a single $entity
Change notice https://drupal.org/node/1882428
Comment #6
clemens.tolboomMaybe better #1969728: Implement Field API "field types" as TypedData Plugins
Done with
Comment #7
jhodgdon7.x only issue now.
Comment #8
clemens.tolboomComment #9
clemens.tolboom@Noe_ a patch bingo during a D8 sprint is risky.
Comment #10
sandykadam commentedFixed added patch for missing param docs
Comment #11
jhodgdonThanks! Looks pretty good. A few minor typographical things to fix:
- Punctuation: e.g. must be followed by a comma. Or better yet, use "for example,", which is less liable to be confused with i.e..
- In Drupal we try to have serial commas, so in the last line, there should be a comma between "language" and "and".
- In the last line, error -> errors
Comment #12
sandykadam commented@jhodgdon Thanks for review, I have updated the patch. Kept e.g with comma because we are using everywhere in documentation.
Comment #13
jhodgdonThanks! Looks fine.
Comment #14
jhodgdonThanks again! Committed to 7.x.
Comment #15
sandykadam commentedThanks @jhodgdon
Comment #16
jhodgdonWeird. Issue status in #14 says I changed it to Fixed, but it was back to RTBC. ?!?
Comment #17
sandykadam commentedYeh you committed the code but you change the status to RTBC!