Since upgrading to version 2.0 of this module, I am seeing two 'Wysiwyg' menu items under 'Site configuration': one points to 'admin/settings/wysiwyg/profile', and the other to 'admin/settings/wysiwyg'. I've tried clearing my cache, but the problem persists.

Maybe a problem with the way that hook_menu() was implemented?

Comments

torrance123’s picture

Same problem here. We have TinyMce 3.x installed, everything else is standard.

twod’s picture

This must have been missed during testing of #434590: admin/settings/wysiwyg not found, prrobably because most of those involved used Admin menu which appears to overwrite duplicate entries. I also have the same problem in the regular menus.

I'm not that familiar with the menu system but I'll take a look unless Sun beats me to it.

candelas’s picture

same problem :)

candelas’s picture

i get this on the modules page

warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'wysiwyg_admin' was given in /home/pangea/akwaba/public_html/web/includes/menu.inc on line 348.

sun’s picture

Status: Active » Postponed (maintainer needs more info)

I can't find the string "wysiwyg_admin" in wysiwyg.module at all. And I also cannot replicate this issue on my test site.

If you properly updated your module, then I suggest to go to admin/settings/performance and click on the "Clear cached data" button. If you use Administration Menu, you can simply click on "Flush all caches" in the icon menu.

dboulet’s picture

Haven't come across the error in #4, I don't think that it's related.

I've ran update.php, and cleared my cache, but I'm still seeing two 'Wysiwyg' menu items at admin/settings.

sun’s picture

Is it possible that you have another (wysiwyg-related) module installed, which still thinks that Wysiwyg API lives under the old path?

dboulet’s picture

Ok, installing version 2.0 on a fresh Drupal install did not reproduce the problem, neither did turning on any WYSIWYG-related modules. I was however able to replicate the bug by installing wysiwyg 2.0-alpha and then upgrading to 2.0.

sun’s picture

Did you alter the old menu item in any way? Changed its title or description? Moved in the tree? Anything like that? The menu system marks any menu item as "customized" when it is altered in any way. If the "owning" module changes the item, those changes don't take effect.

dboulet’s picture

No, I just did exactly what I described in #8: installed Drupal, installed wysiwyg 2.0-alpha, upgraded to 2.0.

Layne’s picture

I have the same problem too. Upgraded from wysiwyg 2.0-alpha as well (re: #8). If it helps, one of the menu links to admin/settings/wysiwyg and the other links to admin/settings/wysiwyg/profile

(as always thanks go to all the contributors!)

candelas’s picture

hello

i went againg to the modules page, and i didnt get the error anymore.
then i cleared the cache as you suggested but i keep having two menus.

i updated from v 1.6 2008/10/28

the first link that i get goes to admin/settings/wysiwyg
and the second to admin/settings/wysiwyg/profile
both of them take me to the same page though

i hope it helps, thanks for your work :)

gunzip’s picture

subscribe, same here afetr upgrading to 2.0

jrust’s picture

subscribe

davidteall’s picture

StatusFileSize
new52.46 KB

I have recently upgraded to 6.x-2.0 and have the same problem. I have attached a screen shot of the appropriate section of the admin page.

lacitpo’s picture

Having the same issue as #4


    * warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'wysiwyg_admin' was given in /home/.lukas/saintandrew/dev.saintandy.org/includes/menu.inc on line 348.

This may be an unrelated issue but just wanted to notify the developer(s)

HasseMan’s picture

As Louis_Trapani noted in #487258: IMG Assist no longer appears after updating to 6.x-2.0 (comment 2) disabling and then reenabling Wysiwyg worked for me as a workaround. Now the menu entry pointing to admin/settings/wysiwyg/profile has been removed.

Oh, and my double entry showed up after upgrading from 1.1 to 2.0.

twod’s picture

I can also confirm the workaround in #17.
And yes, #16 is a different issue which should be resolved when clearing the cache if I'm not mistaken.

promes’s picture

subscribing

EllenM1-1’s picture

Thanks to the user above who suggested un-enabling than re-enabling wysiwyg module. that fixed the errors. Now I need to figure out which is the best editor to install.

HasseMan’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new525 bytes

This problem seem to have been introduced when the page callback was rewritten and moved from admin/settings/wysiwyg/profile to admin/settings/wysiwyg. admin/settings/wysiwyg/profile then got redefined as type MENU_DEFAULT_LOCAL_TASK in order to redirect back to its parent. It looks like the type change, when upgrading, tricks the Drupal menu system into leaving the entry in the menu_links table instead of removing it.

Disabling the module clears the menu entries and reenabling it recreates them, now without the erroneous menu_links table entry.

Possible solutions?
* Add update procedure to README.txt: Update by disabling module before extracting new module files and reenabling it afterwards, then run update.php.
- Is this the correct procedure? Mixed answers in the forums...
* Remove the menu entry from wysiwyg.module.
- Is that recommended? It works in my setup (only wysiwyg and TinyMCE editor) but missing a part of the menu tree looks ugly.
- Will it be used in a later version of the module?
* Manually erasing the menu entry from the DB perhaps in an update function (wysiwyg_update_6002).
- Hack, really ugly. Drupal doesn't seem to want modules touching 'system' module menu entries.

Removing the menu entry appear to be the better solution. Patch supplied.

sun’s picture

StatusFileSize
new1.35 KB

Is someone able to test this patch?

promes’s picture

As every developer of modules should know, according to the official Drupal 6 documention, as of this version, you always should disable and re-enable the module to rebuild the menu entries after changing something in the hook_menu of the module.
This should be in the documentation (install text) of the module and is the only correct way to solve the problem.

The recommended way for any additional module when upgrading to a higher Drupal version is to de-install all additional modules and reanable them after a successfull upgrade.

Therefore I think you shouldn't create a patch, but point above out to everybody.

sun’s picture

Does not apply here. This bug is not caused by an upgrade, but a regular change in the module's code between versions. Users should not have to disable and re-enable a module for regular updates.

promes’s picture

Then you can add the following Drupal call in an update function:
menu_rebuild();
That does the job as well.

sun’s picture

Did you actually read the patch? Contains quite elaborative documentation. If menu_rebuild() would have worked as it should, then this issue wouldn't exist in the first place.

dboulet’s picture

+ * wysiwyg_update_6200() rebuilt the menu, but the menu system does not seem to
+ * understand the 'type' change from MENU_NORMAL_ITEM to MENU_DEFAULT_LOCAL_TASK
+ * and leaves the old link intact as is; perhaps also depending on other modules
+ * being installed (admin_menu?).

Don't think that the last line is needed, if I remember correctly I reproduced this bug with nothing but core and wysiwyg module.

irishgringo’s picture

I am not able to display a WYSIWYG editor either. I get the old...
Page not found
The requested page could not be found.
when editing a page.
I think I remember something like this happening in the past.
I should mention that I just did a DRUSH update. and it was working before the update.

After doing the update ( and breaking my wysiwyg), I tried removing the module.. then flushing running cron... then reinstalled the wysiwyg module... still does not work.
6.x-2.0

any clues?

irishgringo’s picture

i fixed the problem by completely removing the 6.x-2.0 version and installing the DEV version.

sun’s picture

Status: Needs review » Closed (cannot reproduce)

It looks like this issue vanished in the meantime. Otherwise, we'd see many more people on this issue. Thus, closing.