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.
#414424: Introduce Form API #type 'text_format'
Has landed. HEAD is busted.
Comment | File | Size | Author |
---|---|---|---|
#16 | wysiwyg-HEAD.text-format.6.patch | 9.67 KB | TwoD |
#5 | wysiwyg-HEAD.text-format.5.patch | 9.69 KB | sun |
#4 | wysiwyg-HEAD.text-format.4.patch | 9.7 KB | sun |
Comments
Comment #1
jurgenhaasYep, WYSIWYG is no longer working with the latest D7 dev, there is no '#text_format' field anymore, so wysiwyg_process_form() doesn't add the editor to the page anymore.
Comment #2
sunRighto. :) So finally Drupal core can claim "better wysiwyg support" :-D
Our entire logic needs to move into hook_element_info_alter(), assigning a #pre_render for $type['text_format']. All that's done there is to iterate over the available formats, load the profiles, etc. Therefore, gazillion lines of code become ~20.
Note: Also account for the possibility that the textarea may be disabled due to #91663: Permission of text format is not checked when editing an entity and instead reset to something a user can use. -- in that case, we don't load anything at all.
Comment #3
jurgenhaasIn other words that requires an update for the WYSIWYG module, right?
Comment #4
sunComment #5
sunFixed trailing white-space.
Comment #6
jurgenhaasNot sure what else I should do, but so far it's not working to me. I've applied the patch, re-saved the wysiwyg profile and flushed all caches. But when going to /node/1/edit I still do not get back the WYSIWYG editor for the body.
Is there anything else I need to do?
Comment #7
sunNope, it at least worked for me on node/add/article
Only remotely related: #741606: Teaser splitter / text fields with summary support (@Jacob)
Comment #8
jurgenhaasCan't get it to work. There is not even any js file loaded from the wysiwyg module and also no Drupal.settings.wysiwyg is available. I suspect that the function wysiwyg_load_editor($profile) doesn't get called.
Comment #9
jurgenhaasStrange! I've now put some debugging code into the module and suddenly the editor appeared, no idea why.
Now, on to the next area of interest: is there a quick hint on how to define my own form for a textarea that should also load the editor? I guess that's changed now significantly.
Comment #10
jurgenhaasGot it, a sample for the new textarea definition looks like this:
Comment #11
sunum, that snippet contains bugs. See http://drupal.org/node/224333#text_format
Comment #12
jurgenhaasNot sure what you mean? The only difference is that '#format' should get NULL assigned to it instead of the filter_default_format() but in the end that doesn't seen to make a difference!? In http://drupal.org/node/224333#text_format I'm not sure where $edit is coming from.
Comment #13
hefox CreditAttribution: hefox commentedPatch worked for me after clearing cache (well, installing admin_menu to get my cache clear link) without any other actions.
edit: sun had me do more testing, does not work for only 1 allowed input format.
Comment #14
JacobSingh CreditAttribution: JacobSingh commentedHmm... I'm confused. IT works for me (more or less), however the input filter I've selected seems to be getting saved incorrectly because it is not being applied when I view the content. Also, the help text for it seems wrong...
What am I doing?
Comment #15
talkingwires CreditAttribution: talkingwires commentedThe patch works for me, too. Just make sure to go under Configuration/Development/Performance and clear the cache. I'm still setting up my Input Formats, so I can't comment on the issues people are reporting with them...
Comment #16
TwoDJust a quick change.
Is now
$format_field['guidelines']['format']
(in both instances) and now editors work when there is only one format as well.Powered by Dreditor.
Comment #17
sunThanks for reporting, reviewing, and testing! Committed to HEAD.
A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.