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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

junaidpv’s picture

Issue summary: View changes

code formatting.

junaidpv’s picture

One 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.

das-peter’s picture

@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.

junaidpv’s picture

Status: Active » Needs review
FileSize
613 bytes

@das-peter Yes, it is working! I never met variable 'menu_rebuild_needed' before. Thanks for introducing!

Here is updated patch.

  • das-peter committed bf05b83 on 7.x-3.x authored by junaidpv
    Issue #2541048 by junaidpv: Setting "Use Media Browser Plus thumbnails...
das-peter’s picture

Status: Needs review » Fixed

@junaidpv Wonderful, thanks for the updated patch and welcome aboard with the other MBP committers :)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.