I'm trying to use a markup field to hold some HTML, including an image. The problem is, the input format keeps resetting to Filtered HTML, so the image is always stripped out when the form is displayed.

Comments

mandclu’s picture

Did a little rooting in the code, and noticed a couple of things:

There appears to be some inconsistency with how that particular element is named - in most cases 'format', but in at least one place 'filter'.

In the database, nothing is getting saved in the "extra" column.

mandclu’s picture

OK, it looks like two fixes are needed: change the naming to be consistent with 'format', and fix the parents array for the filter_form call. Fortunately, both are fixed by change a single line, number 23:

  $edit_fields['extra']['format'] = filter_form($currfield['extra']['format'], 0, array('extra', 'format'));
WiseTeck’s picture

I can confirm this. (and the fixup done by surge_martin).

quicksketch’s picture

Status: Active » Fixed

Thanks surge_martin, I've committed the fix to 2.x. If you could submit fixes such as this as patches, it makes reviewing and applying the changes easier for me (and fixed faster). Thanks for the help!

mandclu’s picture

Status: Fixed » Postponed (maintainer needs more info)

FYI, the fix in the 2.x branch still has a bug ('field' is still in the parents array, which breaks the functioning in this branch).

I will try to roll a patch, however, and post it here.

quicksketch’s picture

Status: Postponed (maintainer needs more info) » Fixed

Thanks for keeping up on this surge_martin. I removed 'field' from the parents array and tested it working.

Patches are good, keep things easy for me :)

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.