Permalink
Browse files

リソースプレビュー時、OnLoadDocumentObjectにて$modx->documentObjectを変更しても$_POST値で上…

…書きされる問題を修正。
  • Loading branch information...
1 parent a821089 commit 361b7b11d2a8eda6c32c920172ae953b8f56d874 @soushi soushi committed Dec 8, 2014
Showing with 5 additions and 0 deletions.
  1. +5 −0 manager/includes/document.parser.class.inc.php
@@ -1954,6 +1954,10 @@ function getDocumentObject($method='id', $identifier='', $mode='direct')
# this is now the document :) #
$documentObject= $this->db->getRow($result);
+ if( $previewObject )
+ {
+ $snapObject = $documentObject;
+ }
if($mode==='prepareResponse') $this->documentObject = & $documentObject;
$this->invokeEvent('OnLoadDocumentObject');
$docid = $documentObject['id'];
@@ -1995,6 +1999,7 @@ function getDocumentObject($method='id', $identifier='', $mode='direct')
foreach($documentObject as $k=>$v)
{
if(!isset($previewObject[$k])) continue;
+ if( $snapObject[$k] != $documentObject[$k] ) continue; // Priority is higher changing on OnLoadDocumentObject event.
if(!is_array($documentObject[$k]))
$documentObject[$k] = $previewObject[$k];
else $documentObject[$k]['value'] = $previewObject[$k];

0 comments on commit 361b7b1

Please sign in to comment.