(Apologies -- forgot to include the dev.list)

---------- Forwarded message ----------
From: Remco de Boer <remcocdeboer@gmail.com>
Date: Sat, Aug 24, 2013 at 8:51 PM
Subject: Issue with Partial Forms in SF2.5.3
To: semediawiki-user@lists.sourceforge.net


I'm having an issue with partial forms using Semantic Forms 2.5.3. Whenever I edit a page through Special:FormEdit/ThePartialForm/ThePage only new parameter-value pairs are added to the template on the page. Any existing values that are changed through the form are never updated. When the partial form uses a multi-instance template, not even new values are added and the page is never changed at all.

You can verify this behaviour at http://discoursedb.org/wiki/Special:FormEdit/Item_references/Picture_IDs_are_perfectly_sensible (the page that the SF partial forms documentation links to). Just change some of the items and/or add another and then choose 'show changes'. The result will be empty, i.e., no changes are being seen.

I've been poking around a bit in the code of SF_AutoeditAPI.php, and found that:
1. around l.830, after executing [1], the variable $this->mOptions contains the right values, however
2. the correct contents of $this->mOptions appear not to be transfered to the $targetContent variable, which is used to edit the page around l.900 [2]

I am stuck here, since I'm unsure how $this->mOptions and $targetContents are supposed to be related. Can anyone with a better grasp of the SF code design and its inner workings help me solve this issue?

Kind regards,

Remco de Boer


[1] 
// and merge/overwrite it with the new data 
$this->mOptions = SFUtils::array_merge_recursive_distinct( $data, $this->mOptions );

[2]
$editor = $this->setupEditPage( $targetContent );