Content not textiled

Issue #32 resolved
Stef Dawson
created an issue

For some reason the Body/Excerpt are not being Textiled after approving an article in mem_moderation_article. It appears to be down to two factors (or perhaps user error :-)

the array_merge() in mem_article_approver() is overwriting the 'textile_body' and 'textile_excerpt' keys with ones from the inbound $data array, as per the array_merge rules (later keys overwrite earlier ones of the same name).

the 2nd parameter in include/txp_article.php's textile_main_fields() function is called $use_textile but doesn't actually do anything of the sort. It does nothing in fact. The incoming data stream is the only thing that is used to determine whether to textile something or not.

I have worked around these issues by using the construct given in the attached file, from line 565 of mem_article_approver(). A longer term, better solution would be preferred, as would investigation into why the core has a function with a bogus unused parameter, and txp_article.php contains 5 references to global $txpcfg and uses none of them!

Comments (3)

  1. Michael Manfre repo owner

    1. The values for "textile_body" and "textile_excerpt" need to be provided by the form (mem_form_secret is usually best). If they are not being set, then mem_article_approver is correctly use the disabled values.

    2. Thanks for the heads up. $use_textile most likely did something a few versions back and was never cleaned up after the function was refactored. I cleaned up the unused $txpcfg globals, but left the 2nd argument for textile_main_fields() to maintain backwards compatibility.

  2. Log in to comment