Hello everyone!
I'm having this issue that show in differents page in my drupal site but I don't know what's causing the problem.
If someone else is having the same issue, please share.

Thanks in advance.

CommentFileSizeAuthor
#5 2118201-wysiwyg-disabled-profiles-5.patch718 bytesRobin_K
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sammos’s picture

I also have this issue. Changing to bug report. I have Oct 26 build installed.

sammos’s picture

Category: Support request » Bug report
Issue summary: View changes
aschiwi’s picture

We also have this issue with the latest dev.

aschiwi’s picture

Here's what I found out and it seems to get rid of the issue:
I printed a dpm($profile->format); in wysiwyg_admin_profile_title and saw the machine names of 3 wysiwyg profiles, of which only 2 were still on my site. The third was an old one we had deleted via the ui a while ago. But it was still in the database (wysiwyg table). I deleted the table entry and the error was gone.

This should probably be removed in code when the text format / wysiwyg profile gets removed in the ui but I'm just a frontender and wouldn't know where to even start :) This should help others running into this issue though.

Robin_K’s picture

Status: Active » Needs review
FileSize
718 bytes

After some debugging I've found the culprit of this error.
I got the error whenever a Text Format which also had an active wysiwyg profile was disabled in the /admin/config/content/formats page, and Admin Menu 'rebuilt' its menu's.

The Filter module never actually deletes a text format, the filters just get a 'disabled' flag in the database (https://drupal.org/node/1197814).
The connected wysiwyg profile isn't deleted, so it stays in the database.

hook_admin_menu_map uses wysiwyg_profile_load_all to obtain all of the current wysiwyg profiles.

wysiwyg_profile_load_all will return all of the profiles contained in the wysiwyg table, including profiles for the disabled text formats that are still in the database.

This causes problems when Admin Menu builds its menu: it will create menu items for all the obtained wysiwyg profiles, including the profiles from inactive text formats. wysiwyg_admin_profile_title is used to get the title of an editor profile, and uses thefilter_format_load function. This function will return FALSE when a format is disabled or not found, resulting in an error.

There are multiple solution to this problem, my solution is to prevent wysiwyg from returning profiles linked to disabled text formats, as there is currently no way to reenable a text format (and its wysiwyg profile) without going into the database.

Attached is a patch which changes wysiwyg_profile_load_all to only return profiles linked to active text formats. This fixed the problem for me.

Robin_K’s picture

Component: Editor - CKEditor » Code
sheldonkreger’s picture

Status: Needs review » Reviewed & tested by the community

#5 works for me.

aimeerae’s picture

#5 works for me, thank you!

Yuri’s picture

Has this been committed?

TwoD’s picture

Status: Reviewed & tested by the community » Fixed
Related issues: +#2186591: Disabled filter formats with wysiwyg profiles attempt to get displayed in admin menu

Rebuilding the Admin Menu no longer tries to add links to profiles assigned to disabled formats as of #2186591: Disabled filter formats with wysiwyg profiles attempt to get displayed in admin menu.

Status: Fixed » Closed (fixed)

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