Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
My friends ask me how to alter a cck field, a cck widget and cck formatter because he need to alter to make change field made by other module.
Comment | File | Size | Author |
---|---|---|---|
#4 | content-info-alter-00.patch | 1.4 KB | smokris |
#1 | cck-998838.patch | 1.1 KB | Shellingfox |
Comments
Comment #1
Shellingfox CreditAttribution: Shellingfox commentedHere is my patch. It'll alow CCK field, CCK widget and CCK formatter can alter using:
Comment #2
Shellingfox CreditAttribution: Shellingfox commentedComment #3
eric.chenchao CreditAttribution: eric.chenchao commentedSubscribe
Comment #4
smokris+1 for this idea.
In the patch attached to #1, however, the drupal_alter hook gets called repeatedly on the same data (first it gets called on $info which contains module A's data, then on $info which now has data from module A+B, then A+B+C, ...).
I've attached a revised patch, which calls drupal_alter on the data before it gets added to the $info array.
Comment #5
NiklasBr CreditAttribution: NiklasBr commentedIt would be lovely if this patch made it into CCK.