Needs work
Project:
Excerpt
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Apr 2009 at 20:45 UTC
Updated:
13 Oct 2010 at 22:01 UTC
Jump to comment: Most recent file
I don't know if this is a excerpt issue or a wysiwyg issue, so I figured I'd start here.
I have the wysiwyg module installed with fskeditor. The full story comes up with the fskeditor just fine, but the excerpt area does not. Is there anyway to enable this?
| Comment | File | Size | Author |
|---|---|---|---|
| #52 | excerpt_d5-429364-52.patch | 5.32 KB | agileware |
| #33 | 429364_teaser_format_3x.patch | 5.5 KB | hanoii |
| #28 | 429364_teaser_format.patch | 5.17 KB | hanoii |
| #30 | 429364_teaser_format_2x.patch | 5.22 KB | hanoii |
| #21 | excerpt_wysiwyg2p0.patch | 1.37 KB | keesje |
Comments
Comment #1
mike15 commentedI'm in the same boat. subscribing...
Comment #2
sylvaingirard commentedIt's not linked to a specific editor. I'll try to take a look at it.
Comment #3
hydrogen3 commentedalso subscribing
Comment #4
mr.andrey commentedsubscribing...
Comment #5
tommytob commentedsame issue for tinymce
Comment #6
smithn.nc commentedSubscribe.
Comment #7
hayesr commentedThis sounds like a problem with wysiwyg module to me. (I say that because Excerpt does relatively little in the way of Drupal API calls, but if Excerpt's the culprit I'm happy to fix it) Is there someone who can confirm the source of the problem?
Comment #8
rondev commentedFor people looking for a Wysiwyg solution, The one I found working together for my needs is:
Excerpt 6.x-1.x-dev (2009-mai-23)
FCKeditor - WYSIWYG HTML editor 6.x-2.0-beta1
More over for images:
Image Assist 6.x-2.0-alpha3 (later releases not tested)
Comment #9
adamo commentedIn order for the Wysiwyg API module to work for the teaser field, you need to add support for input formats to the Teaser field. You would just do the same thing that was done with the Body field. Markup really shouldn't be allowed in the field unless there is an input format specified. Could be a security issue.
Comment #10
hayesr commented@adamo Can you provide a patch? If not I'll look at it as soon as I can, but can't this week.
Comment #11
Jaza commentedPretty simple fix. Just as the 'body' element is defined as follows in node.module:
The same needs to be done for the 'teaser' element by excerpt.module (i.e. it need to be wrapped in a parent element, and it needs a sibling 'format' element, in order for Wysiwyg to treat it as an input format-enabled textarea):
Patch attached. Tested with TinyMCE enabled in latest stable Wysiwyg module for Drupal 6.
Comment #12
keesje commentedHi, thanks for sharing.
Tested your patch, in my case it enables wysiwyg for excerpt field, but removes it form body field. Hmm.
Investigating this.
Comment #13
keesje commentedIf i mimic excerpts behaviour by adding a textarea by CCK, multiple wysiwygs are loaded without probs.
I think excerpt needs to change something in the form field declaration to enable filter formats at API level? Don't have time right now to dig into this.
Comment #14
adamo commentedIn order to have multiple text areas with different filter formats on the same form you need to use the $parents parameter of filter_form(). I don't have time to devote to doing a proper patch right now but I'm going to paste a quick and dirty example of what I had to do to to get this to work in another project. Hope it helps.
Comment #15
ryan.nauman commentedsubscribing
Comment #16
jaxpax commentedsubscribing
Comment #17
W.M. commentedsubscribing
Comment #18
droopy commentedsubscribing
Comment #19
W.M. commentedI have solved the problem by using CCK to create an extra textarea field (and excluding it from front page and node content page). It still appears in editing page. So I write the customized teaser inside it (it supports TinyMCE and other editors) and copy and paste the finished HTML code inside the teaser box of Excerpt (make sure that TinyMCE is configured to show the HTML code button inside editor so you will be able to see the full code and copy & paste it).
Not perfect solution but works perfectly!
Comment #20
Boarder commentedJaza's patch almost solved it for me. But as kees@qrios pointed out the Body textarea doesn't get tinymce anymore. The fix is to change
$form['teaser_field']['format'] = filter_form($form['#node']->format);with something like
$form['teaser_field']['format'] = filter_form($form['#node']->format, null, array('teaser-format'));The reason for that is that the Format radiobuttons of both the body textarea and the Excerpt textarea are going to have the default name "format". As such, only one of the 4 radiobuttons can be selected (even among both Format radiobuttons). Consequently, in the wysiwyg javascript where the editors are inserted, no selected radiobutton is found in the Body Format options and thus no TinyMCE is added.
The above fix gives a new name to the radiobutton group of the excerpt and thus we finally end up with two Format setting groups. Now I have TinyMCE working with the excerpt module.
Comment #21
keesje commentedPlease test altered patch, changed as outlined in #20
Comment #22
W.M. commentedAny success using this patch?!
Comment #23
jakob_dunning commentedI used the patch and it worked just fine.
Thanks a lot. Before, excerpt never created node teasers automatically until i went to the 'edit' pane and saved the node without changing.
Using Drupal 6.x-1.2, ercerpt module 6.x-1.0, wysiwyg 6.x-2.0.
Comment #24
W.M. commentedThe patch worked perfectly. Thanks.
Comment #25
jakob_dunning commentedThe patch worked fine. Then I installed the FCKEditor standalone module, image_reference and imagebrowser and now it doesn't anymore. I deinstalled everything again but still no luck.
I found out, that the teaser is auto-generated when i click on "disable rich-text" and delete the line
"<p> </p>",which is automatically inserted by FCKEditor (Wysiwyg plugin) and then save the node.Any suggestions anyone?
Thanks, Jakob
Comment #26
hanoiiIs the patch working or not?
@jakob_dunning: Please, do not set issues as fixed. That status is reserved to the module maintainer when they actually commit the code to the CVS and the patch becomes part of the code, otherwise, this is still an active issue. In any case, if a few report the patch as working, you have the 'reviewed & tested by the community' status which let the maintainer know that the patch has been reviewed.
Comment #27
hanoiiComment #28
hanoiiI had to go over this issue as I needed to have this module fixed. Unfortunately, although the last patch (#21) works, it still needs work.
If we are going to give the option to select a different format for the teaser (which is great, not only because of the out of the box wysiwyg support), that has to be stored somewhere and processed appropriately. The patch on #21 was using $form['#node']->format to feed the format for the teaser, so even if I want a different format for the teaser, I won't be able to set it because it won't be saved. And, IMO, if the format radios are going to be there, they have to serve some other purpose that just a workaround the wysiwyg issue.
Attached is a patch that solves this by doing more things. It was not my goal to make a simple module difficult, but I saw no other option. In any way, it doesn't really change the user interface, just a bit more logic is needed in the code. The patch covers the following:
remember to run update.php after applying this patch
- Definition of a new schema table in excerpt.install to store teaser format (serves as an entry point for more extra info if ever needed).
- Definition of an update function to create the schema in case you currently have the module installed (run update.php to do this!).
- Logic in hook_nodeapi() to insert/update/delete the teaser format data in the new schema (revisions properly supported).
- Fixed the '#weight' of the teaser which now has to be moved to the parent array (teaser_field) rather than the actual 'teaser' textarea).
- Proper use of the parent argument for the filter_form() function
- The teaser is now 'created' by this module rather than relying on the node_prepare() function, and so, we want that to be set first of all, so we don't mess with other module's teaser modifications (such as cck). For that I set the weight of this module to -10 on the .install file. The teaser format is used for creating the teaser, so you can have a different format.
Tests and feedback for this patch are very much appreciated.
Comment #29
hanoiiComment #30
hanoiiAttached is a new patch with one addition:
- Use the same amount of rows as the body field
Comment #31
W.M. commentedWould you please release a new and updated version of this great small module. I am not sure how to make all these changes after I have applied the previous working patch (posted on September 7, 2009 - 08:07). Any help will be appreciated. Can you post the updated excerpt.module & excerpt.install files ?!
Comment #32
W.M. commentedI have now made all changes as outlined in the recent patches. Everything works fine but for already created nodes the excerpt field always loads in filtered-html even if that is changed to full-html and node is saved. Newly created nodes don't show this problem.
Comment #33
hanoiiRight. I have checked this and you are right, attached is a patch with that fixed. Not information should be stored properly for existing nodes.
When it comes to applying the patches on this issue, I suggest you to start with a fresh excerpt-6.x-1.x-dev and apply my latest patch. That should include all the fixes discussed in the previous patches.
Comment #34
W.M. commentedWorking fine !
Comment #35
hanoiiI just got CVS access so I might soon commit this and release a new version, any other tester out there?
Comment #36
rondev commentedNot for me :-(
I go back to previous patch released on #21.
Comment #37
hanoii@rondev: What happened? What went wrong?
Comment #38
rondev commentedI would like to be more descriptive but there is not much to say.
The teaser area is normal, just without tinymce in my case.
I don't know how to investigate more.
Comment #39
hanoiiHave you had properly configured wysiwyg profiles and you made sure that the actual input format selected for the teaser was the one that has your tinymce configured for? Are you using wysiwyg module right? what versions?
I am almost positive this improvement has to work, but just wondering why it hasn't for you.
Thanks,
a.=
Comment #40
rondev commentedNot sure 100%.
Works OK with #21. copy files of dev 2009-Oct-09 then doesn't work. copy files of #21, works again.
No input format asked for the teaser.
Wysiwyg 6.x-2.x-dev (2009-sept.-18)
TinyMCE TinyMCE 3.2.7
Comment #41
hanoiiOh, OK. This patch hasn't been committed to CVS yet, I was hoping to get some more feedback before I do it. If you donwload the Oct-9 dev version, you still need to apply the patch on #33 and run update.php to try this out. If you can do so and report back, that'd be great.
Comment #42
rondev commentedThat was a misunderstood. What was strange is I found the excerpt.install no really different.
The patched one is bigger.
OK. updated test site. TinyMCE works well in teaser area. Thank you.
Comment #43
hanoiiCommitted, thanks for testing and getting back. Will soon release a new version with this fix.
Comment #44
racakg commentedI update Excerpt module to 6.x-1.1 and I notice that Input format under Teaser field doesn't work. Input format under Body field working fine like before. Why Input format under Body field overrides anything I check in Input format under Teaser field? I don't run any wysiwyg. Thanks
Comment #45
hanoii@racakg: Have you run update.php in your site? It needs to be run so the new schema gets created.
Comment #46
racakg commentedSure, i run update.php after I update to new modules. I also update Panels and Chaos tool suite in the same time with Excerpt module.
Comment #47
jakob_dunning commentedI am using the patch comitted in #33 against the 6.x-1.x-dev made on Oct. 19th.
Still no luck with autogeneration of teasers.
Before, I could manually delete the code in the fckeditor window after turning off rich-text and then it would autogenerate a teaser. That doesn't work anymore.
Apart from that, there are input format options on both the body and the teaser field, both rich-text-activated.
Does anyone have an idea how to troubleshoot this?
Comment #48
W.M. commentedRuns fine here (also the latest stable release). Thanks for this great module! I hope the default html-code feature will be integrated in the future.
Comment #49
racakg commented@hanoii: I double check update lines and system weight = -10 in database and everything was updated ok there. The only solution for me is removing unused line until someone else report the same problem:
$form['teaser_field']['format'] = filter_form($form['#node']->teaser_format, 1, array('teaser_format'));
Comment #50
hanoii@jakob_dunning: the auto-generation of teaser should not be related to this issue, so please leave this one fixed unless you find anything not working in terms of wysiwyg and excerpt, related to this fix. Also, please, if you experience such a problem, can you please open a new issue about this problem and we can follow discussions about that. As a comment, I did try this and the teaser seems to be auto-generated fine on my side
@racakg: I am not sure if I follow your problem then. I am trying it w/o wysiwyg and it seems fine. Basically, you should be able to select input formats for both teaser and body independently, is this not working for you? Can you try this module with a fresh drupal install just to make sure anything else is conflicting, although I don't think there's a conflict. I just did this, and all seems just fine. Can you confirm, when you save a node, that something is written to the excerpt table?
Comment #52
agileware commented@hanoii & racakg
I think the problem is because of the code in node_prepare.
Specifically it runs this
That code runs before hook_nodeapi is called so by the time we get it it's been done already.
The way I got around this is to relead the teaser from the database in hook_nodeapi.
It is a little bit of a hack but with the negative module weight we are getting in before other modules implementing hook_nodeapi so we shouldn't be overwriting anything.
I have done a D5 version of your patch with my changes to fix this issue included (against the current 5.x-1.x-dev version).
I haven't got time to make a patch to fix the d6 version sorry but you can use the code from this d5 patch.
Also, an option on the node type edit form to set whether or not to use input formats would be good.
You could copy the method used in cck's text sub-module for the radio button options so there is naming consistency.
Comment #53
agileware commentedThe patch in #52 interferes with the corerct functionality of the poll module... and possibly other modules if they insert things into the $node->content.
So it needs some work in regards to that.
Comment #54
nedjoOpened #940952: Roll back #429364 suggesting rolling back this patch.
Comment #55
agileware commentedThere are definitely issues with this approach so I'd be for rolling this back and approaching it differently too.