Permalink
Browse files

Make rcs toggling actually work

  • Loading branch information...
flack committed Dec 5, 2018
1 parent ae59608 commit d8cf6d7e0863c2557197a9241ba415417273b45d
Showing with 8 additions and 14 deletions.
  1. +8 −14 lib/midcom/helper/metadata.php
@@ -246,6 +246,9 @@ public function release_datamanager()
*/
public function set($key, $value)
{
// Store the RCS mode
$rcs_mode = $this->__object->_use_rcs;
if ($return = $this->_set_property($key, $value)) {
if ($this->__object->guid) {
$return = $this->__object->update();
@@ -254,6 +257,8 @@ public function set($key, $value)
// Update the corresponding cache variable
$this->on_update($key);
}
// Return the original RCS mode
$this->__object->_use_rcs = $rcs_mode;
return $return;
}
@@ -290,9 +295,6 @@ private function _set_property($key, $value)
return false;
}
// Store the RCS mode
$rcs_mode = $this->__object->_use_rcs;
switch ($key) {
// Read-only properties
case 'creator':
@@ -319,8 +321,7 @@ private function _set_property($key, $value)
$value = new midgard_datetime(gmstrftime('%Y-%m-%d %T', $value));
}
$this->__metadata->$key = $value;
$value = true;
break;
return true;
case 'approver':
case 'approved':
@@ -333,19 +334,12 @@ private function _set_property($key, $value)
case 'navnoentry':
case 'score':
$this->__metadata->$key = $value;
$value = true;
break;
return true;
// Fall-back for non-core properties
default:
$value = $this->__object->set_parameter('midcom.helper.metadata', $key, $value);
break;
return $this->__object->set_parameter('midcom.helper.metadata', $key, $value);
}
// Return the original RCS mode
$this->__object->_use_rcs = $rcs_mode;
return $value;
}
/**

0 comments on commit d8cf6d7

Please sign in to comment.