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.
Problem/Motivation
Today Scrambler has no integration to export the settings through the Features module.
Proposed resolution
Use ctools to enable this integration.
Remaining tasks
- New column needed field_name in scrambler_field table.
- Add ctools as dependency.
- Use ctools as export api in hook_schema().
- Write upgrade path with hook_update_N().
User interface changes
- Add column field id to the administrative View.
- Change column field name to the administrative View.
API changes
None.
Data model changes
Open question: should field id still be the primary key or can we work with the field's machine name?
Comment | File | Size | Author |
---|---|---|---|
#7 | 2946359-add-support-for-features-7.patch | 7.35 KB | tim@lammar.be |
#5 | 2946359-add-support-for-features-5.patch | 7.25 KB | Novitsh |
#2 | 2946359-add-support-for-features.patch | 7.17 KB | Novitsh |
Comments
Comment #2
Novitsh CreditAttribution: Novitsh as a volunteer and at Dazzle commentedComment #3
Novitsh CreditAttribution: Novitsh as a volunteer and at Dazzle commentedComment #4
beerendlauwers CreditAttribution: beerendlauwers as a volunteer commentedWhy are you checking against a
0
? Perhaps the empty string or usingisset
would be better ?Perhaps add a comment here why you do the
-1
check?Comment #5
Novitsh CreditAttribution: Novitsh as a volunteer and at Dazzle commentedUpdated version attached, thanks for the feedback!
Comment #6
tim@lammar.be CreditAttribution: tim@lammar.be at Capgemini commentedOriginally your schema had 1 field (fid), now you are adding field_name.
You want to automatically add the machine name of each field already in this table, right?
In that case, instead of using an update hook inside a foreach loop, I would use a bulk delete/insert instead. (this action affects all the records anyway)
You already start by doing a select to get all fids.
Next i would truncate the whole table.
Next, based on your $fid array, you can build a bulk insert hook.
Something like:
Comment #7
tim@lammar.be CreditAttribution: tim@lammar.be at Capgemini commentedHereby the patch file of my previous comment.
Comment #8
nico.knaepen CreditAttribution: nico.knaepen at Logic in Motion commentedThere is no specific reason why I started by using field id instead of the field machine name. It's just my way of working for all kind of relations in tables. So I don't see an issue to switch to the field machine name.
Comment #10
Novitsh CreditAttribution: Novitsh as a volunteer and at Dazzle commentedThx all for the testing. Commited.