When querying the database, the saved path for every single menu item icon is 'sites/all/modules/contrib/menu_icons/images/default_icon.png' instead of the uploaded file.

Comments

acrollet’s picture

looking into this one, thanks!

acrollet’s picture

Status: Active » Postponed (maintainer needs more info)

I'm unable to reproduce this issue with the latest code. I've rolled a new release, please try with 7.x-3.0-beta2 and let me know if it does not resolve the issue.

jenlampton’s picture

Title: Uploaded menu icon doesn't save correct path » Uploaded menu icon doesn't show correct default_value
Version: 7.x-3.0-beta1 » 7.x-3.x-dev
Status: Postponed (maintainer needs more info) » Active

I've updated to the dev version, and now it looks like the path is being saved correctly.

Unfortunately, the #default_value for path is not being populated into the form correctly - it's trying to use the default value for enabled instead.

$form['icon']['use_icon_logo'] = array(
      '#type' => 'checkbox',
      '#title' => t('Use an icon'),
      '#default_value' => $options['menu_icon']['enable'],
      '#tree' => FALSE,
      '#description' => t('Check this if you want this icon to be used.'),
    );

should be

$form['icon']['use_icon_logo'] = array(
      '#type' => 'checkbox',
      '#title' => t('Use an icon'),
      '#default_value' => $options['menu_icon']['use_icon_logo'],
      '#tree' => FALSE,
      '#description' => t('Check this if you want this icon to be used.'),
    );
acrollet’s picture

Priority: Major » Normal
Status: Active » Postponed (maintainer needs more info)

I'm afraid I'm not seeing your meaning - the default value for use_icon_logo is correctly populated from the options stored in the menu_link table, as is the default value for the icon_path form element. Could you clarify what you mean, or perhaps mention what problem you're seeing in use?

jenlampton’s picture

Maybe I'm misreading things, I'll play with it some more and see if I can clarify the problem. If I can fix it I'll add a patch.

acrollet’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)