Problem/Motivation
Exporting breakpoint groups with features leads to some inconsistent output.
There are notices about missing variables and the relation between breakpoint groups and breakpoints isn't exported at all.
Further the export in the UI heavily differs from that in features.
Proposed resolution
Add breakpoints_breakpoint_group_export()
as export callback
to the schema definition of breakpoint groups.
Refactor breakpoints_breakpoint_group_export()
to only export the machine names and not the whole class of the related breakpoints. Further adjust the output to respect the coding standard as well as respect the indent of the export context .
Modify breakpoints_admin_breakpoint_group_export_form()
to display dedicated textareas for the breakpoint group export and the related breakpoints.
Remaining tasks
All those changes are done in the attached patch.
Review needed, I'm not sure if I covered all export scenarios.
User interface changes
The form for the breakpoint group export (admin/config/media/breakpoints/groups/%group/export
) contains two textareas now. One for the breakpoint group and one for the related breakpoints.
API changes
none
Comment | File | Size | Author |
---|---|---|---|
breakpoints-fix-export.patch | 3.92 KB | das-peter | |
Comments
Comment #1
Lukas von BlarerWorks for me.
Comment #2
attiks CreditAttribution: attiks commentedThanks, fixed in latest dev
Comment #4
Bart Vanhoutte CreditAttribution: Bart Vanhoutte commentedHas this patch been committed? Still have the error with both latest dev and recommended versions:
Notice: Trying to get property of non-object in breakpoints_breakpoint_group_export() (line 642)
Comment #5
Jelle_SWhen do you get the error? I tried both exporting through the UI as with Features module and both worked fine.
Meanwhile I added hook_features_export for breakpoint_group so that when a breakpoint group is exported with features, its breakpoints are automatically detected as a dependency and exported as well.
Comment #6
attiks CreditAttribution: attiks commentedComment #7
znerol CreditAttribution: znerol commentedFollow-up: #2296321: Do not automatically export breakpoints defined in theme to Features