mirror of
https://github.com/processwire/processwire.git
synced 2025-08-09 08:17:12 +02:00
Fix issue processwire/processwire-issues#24 findPagesSelector containing "=page.id" when used outside original intended context, fix ensures it continues to work without dependent selects
This commit is contained in:
@@ -365,7 +365,7 @@ class InputfieldPage extends Inputfield implements ConfigurableModule {
|
|||||||
$value = null;
|
$value = null;
|
||||||
if($form && (!$subfield || $subfield == 'id')) {
|
if($form && (!$subfield || $subfield == 'id')) {
|
||||||
// attempt to get value from the form, to account for ajax changes that would not yet be reflected on the page
|
// attempt to get value from the form, to account for ajax changes that would not yet be reflected on the page
|
||||||
$in = $form->get($field);
|
$in = $form->getChildByName($field);
|
||||||
if($in) $value = $in->attr('value');
|
if($in) $value = $in->attr('value');
|
||||||
}
|
}
|
||||||
if(is_null($value)) $value = $page->get($field);
|
if(is_null($value)) $value = $page->get($field);
|
||||||
@@ -374,6 +374,7 @@ class InputfieldPage extends Inputfield implements ConfigurableModule {
|
|||||||
$selector = str_replace($tag, "=$value", $selector);
|
$selector = str_replace($tag, "=$value", $selector);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $selector;
|
return $selector;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -469,7 +470,10 @@ class InputfieldPage extends Inputfield implements ConfigurableModule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($template_id) $inputfield->template_id = $template_id;
|
if($template_id) $inputfield->template_id = $template_id;
|
||||||
if($findPagesSelector) $inputfield->findPagesSelector = $findPagesSelector;
|
|
||||||
|
if($findPagesSelector) {
|
||||||
|
$inputfield->findPagesSelector = self::getFindPagesSelector($page, $findPagesSelector);
|
||||||
|
}
|
||||||
|
|
||||||
if(strlen($labelFieldFormat) && $labelFieldName === '.') {
|
if(strlen($labelFieldFormat) && $labelFieldName === '.') {
|
||||||
$inputfield->labelFieldName = $labelFieldFormat;
|
$inputfield->labelFieldName = $labelFieldFormat;
|
||||||
|
Reference in New Issue
Block a user