Upon selecting a preset snippet, the teaser splitter no longer functions.

Comments

greg.harvey’s picture

Title: Selecting a snippet breaks teaser splitter » Selecting a snippet breaks teaser splitter - need to rebuild body form field using node.module function

Ok - the site we created it for doesn't use the teaser splitter. I've a good idea what the issue is though. When the node body field is rebuilt after the AHAH submission we can't use the node module's function for building the body field, because drupal_render() puts it in an additional div and it breaks. I need to look at this more closely. Don't want to end up duplicating a node.module function. There must be a way to utilise it in this context so we don't break certain node behaviours.

greg.harvey’s picture

Looked at this today. Unfortunately, using the node_body_field() function is not going to be trivial. I think some kind of a copy of it maybe needs to be implemented, but I hate that idea too. Yet to find an elegant solution to this, but I think it holds the key to a number of issues. I also tried building just for the textarea and drupal_render()ing that but it also failed, and as soon as you deviate from the node form's expected structure then your data is lost on save.

For now I'll have to leave this alone, but if someone has time to look at it over the next 4 weeks then that would be great. I'll be away, unfortunately.

greg.harvey’s picture

Assigned: Unassigned » greg.harvey
Status: Active » Needs review

Reminding myself to test this is still the case, since it may have been fixed by #527622: WYSIWYG editors disappear after node body rebuild and switching filter does not bring them back