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.
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.
Comment | File | Size | Author |
---|---|---|---|
#5 | 2118201-wysiwyg-disabled-profiles-5.patch | 718 bytes | Robin_K |
Comments
Comment #1
sammos CreditAttribution: sammos commentedI also have this issue. Changing to bug report. I have Oct 26 build installed.
Comment #2
sammos CreditAttribution: sammos commentedComment #3
aschiwi CreditAttribution: aschiwi commentedWe also have this issue with the latest dev.
Comment #4
aschiwi CreditAttribution: aschiwi commentedHere'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.
Comment #5
Robin_K CreditAttribution: Robin_K commentedAfter 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
useswysiwyg_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.Comment #6
Robin_K CreditAttribution: Robin_K commentedComment #7
sheldonkreger CreditAttribution: sheldonkreger commented#5 works for me.
Comment #8
aimeerae#5 works for me, thank you!
Comment #9
Yuri CreditAttribution: Yuri commentedHas this been committed?
Comment #10
TwoDRebuilding 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.