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.
Here's a collection of small changes I made to work with ctools & panels in D7.
I tried to group the changes by topic / file to make it easier to apply and review.
ctools-context-admin-form-definition:
- Added several keys to form specific arrays to get rid of "Undefined index" notices
- Removed unnecessary variable definitions (
$position
) ctools_context_get_defaults
needs review. Removed constructs that looked legacy- Removed trailing space
ctools-context-inc:
- Added
$plugin
as parameter in some cases. Some of the function seem to rely on this information - but I can't remember which one exactly. - Create a more specific name for converters.
- Use
entity:user
insteaduser
to load user context. - Added additional check for
$access['logic']
to make sure theres no "Undefined index" notice - needs review
ctools-context-theme-inc:
- Prevent "Undefined index" notice. But I'm actually not sure if is / should be description optional.
ctools-field-inc:
- Make sure the settings of a field formatter are always set.
- Duplicate of #980524: ctools_fields_get_field_formatter_info should invoke all modules to find field formatters
ctools-notices-fixes:
- Prevent "Undefined variable" notice. Duplicate of #980528: ctools_entity_field_content_type_formatter_styles_submit: Check if there are settings, before iterate over them.
- Prevent "Only variables can be passed by reference" warnings.
ctools-vocabularies-and-terms:
- Changed naming to be entity compliant.
ctools-views_panes-smarter-title:
- Better title for views_panes.
Comment | File | Size | Author |
---|---|---|---|
#6 | ctools-notices-fixes-1014866-6.patch | 1.36 KB | das-peter |
#6 | ctools-plugins-admin-inc-1014866-6.patch | 532 bytes | das-peter |
#4 | ctools-views_panes-smarter-title.patch | 623 bytes | das-peter |
ctools-context-admin-form-definition.patch | 2.48 KB | das-peter | |
ctools-vocabularies-and-terms.patch | 1.87 KB | das-peter |
Comments
Comment #1
merlinofchaos CreditAttribution: merlinofchaos commentedOne review. Still working.
Should be a translated title. Something like t('%display [%view]'). It should probably also be consistent with how views are listed in the block UI in the same circumstance.
Comment #2
merlinofchaos CreditAttribution: merlinofchaos commentedI don't see how this can be right? Am I missing something?
Comment #3
EclipseGc CreditAttribution: EclipseGc commentedA lot of these look really great, but with this many changes, I'd much rather a handful of small patches need a little revisiting than re-rolling a 750 line patch regularly and often. Can I side track this train into getting some review on #951048: Support Subtypes for Arguments, Context and Relationship plugins before we go altering large sections of the code base again?
My patch is altering:
includes/content.menu.inc
includes/context.inc
includes/context.plugin-type.inc
plugins/access/term.inc
plugins/access/term_parent.inc
plugins/access/term_vocabulary.inc
plugins/arguments/entity_id.inc
The rest are new files.
I think specifically I'd like to see a hold on:
ctools-context-inc.patch
ctools-vocabularies-and-terms.patch
The rest are probably fine.
Eclipse
Comment #4
das-peter CreditAttribution: das-peter commentedThank you guys for your feedback.
#1:
Changed it to how it's done in views_plugin_display_block.inc
execute_hook_block_list()
.#2:
Well, my approach was very lazy. There's no
$id
nor$object
- thus remove the constructs.Does anything obviously fail - if not = done.
Thus it's very likely that this isn't properly fixed - and if someone can give my a direction I'll fix it.
Btw. this seems the last place where
ctools_get_keyword()
was used.#3:
Let's skip the patches here touched by #951048: Support Subtypes for Arguments, Context and Relationship plugins. I'll keep an eye on it and make later a reroll where necessary.
Comment #5
merlinofchaos CreditAttribution: merlinofchaos commentedCommitted smarter title panes and context-theme.inc Marking the rest needs work.
Comment #6
das-peter CreditAttribution: das-peter commentedPatches cleaned:
ctools-plugins-admin-inc: Removed patch duplication
ctools-notices-fixes: Remove duplication of ctools-plugins-admin-inc.
Comment #7
merlinofchaos CreditAttribution: merlinofchaos commentedResetting status
Comment #8
merlinofchaos CreditAttribution: merlinofchaos commentedCommitted. I know there are more mostly related to entities; let's follow them up in separate issues as I'm having trouble tracking everything here.
Comment #10
pillarsdotnet CreditAttribution: pillarsdotnet commentedSee related: #1241170: Undefined variable $id in ctools_context_get_defaults() (line 619 of includes/context-admin.inc)