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.
The setting "Use Media Browser Plus thumbnails view as default." in page 'media/media_browser_plus_settings' does not work as expected.
It we save that setting page at least once then opposite of that setting will happen on page 'admin/content/file'. If checkbox ticked, then 'Files' tab will be default tab (opposite expected) when checkbox unticked then 'Thumbnails Plus' becomes default (opposite expected).
The problem arise because menu_rebuild()
is called in media_browser_plus_media_settings_submit()
before actual setting is saved on db.
Comment | File | Size | Author |
---|---|---|---|
#4 | configuration_issue-2541048-4.patch | 613 bytes | junaidpv |
#2 | configuration_issue-2541048-2.patch | 1.15 KB | junaidpv |
Comments
Comment #1
junaidpvcode formatting.Comment #2
junaidpvOne solution is to update user submitted value on global $conf variable. So
hook_menu_alter()
will get correct value for menu altering.Here is the patch with proposed fix.
Comment #3
das-peter CreditAttribution: das-peter at Cando commented@junaidpv Nice catch! :) But how about using
variable_set('menu_rebuild_needed', TRUE);
. This should trigger a menu rebuild on the next page load. Which means by then the settings are consistent too. Further this might avoid multiple menu rebuilds in one run (unlikely but you never know).Sidenote: Please set issues with patches to "Needs review" - I more often scan for tickets which have stuff to review.
Comment #4
junaidpv@das-peter Yes, it is working! I never met variable 'menu_rebuild_needed' before. Thanks for introducing!
Here is updated patch.
Comment #6
das-peter CreditAttribution: das-peter at Cando commented@junaidpv Wonderful, thanks for the updated patch and welcome aboard with the other MBP committers :)