Hi,
I'm creating a plugin to shuffle the contents of a field (mentioned it in other posts). I'm using this field for the article alias and my only issue with it is that when on Edit mode, it kicks in again and changes the alias (which is bad if the article was already shared. This was also mentioned in a different post). Here is the code I'm playing with now:
if ($value != $field->defaultvalue) {
$value=$field->value; }
else {
$value = $shuffler; }
This, in theory, should do the following:
1) Check to see if the field's value is it's default value. If it NOT the default value, keep value equal to whatever is currently filled into the field (presumably an alias).
2) If it IS the default value, then this is probably a brand new article, in which case, the value is $shuffler (my shuffle variable).
It seems that $value = $field->value is not working, nor is $field->value = $value. I'm doing this right before parent::g_onCCK_FieldPrepareStore_Validation, towards the end of the plugin.
So, how do I get $value equal to the stored/live/current value of $value?
Thanks!