Author: info
Description:
Yaron Koren in http://www.mail-archive.com/semediawiki-devel@lists.sourceforge.net/msg00319.html pointed out that there's a bug in the handling of properties of type "Page" that are enumerations - fields that have this property get a "not on the list of possible values" error on the screen if they have a value other than the very first one on the list.
I reproduced, see URL.
Yaron comments:
I traced this problem, and found the issue: a variable is created, in "SMW_DataValue.php", to loop through the list of allowed values, checking each one against the current value. In the case of a wiki page, however, that variable keeps a cached version of its title, that is set the very first time and then is never reset. There are are various ways to solve this problem, but the easiest might be to change the function parseUserValue() in the file "/includes/SMW_DV_WikiPage.php". You can add a new line after line 26, so instead of
$this->m_value = $value;
...it now reads
$this->m_value = $value; $this->m_title = null;
This will prevent the old value of "m_title" from getting read and used in place of the actual value.
skierpage comments:
This fix works great for me. However, there are other member variables that parseUserValue() may leave untouched, though mainly in an error case where maybe it doesn't matter. Which functions should reset a datavalue, setUserValue() or parseUserValue(), or both?
Version: unspecified
Severity: major
URL: http://ontoworld.org/wiki/Test_allows_value_wikipage