mirror of
https://github.com/processwire/processwire.git
synced 2025-08-24 15:23:11 +02:00
Fix issue processwire/processwire-issues#656 where recently added Inputfield::setParent() update was causing issues (ListerPro config tab as one example)
This commit is contained in:
@@ -492,16 +492,6 @@ abstract class Inputfield extends WireData implements Module {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function setParent(InputfieldWrapper $parent) {
|
public function setParent(InputfieldWrapper $parent) {
|
||||||
if($this->parent && $this->parent instanceof InputfieldWrapper && $this->parent !== $parent) {
|
|
||||||
$oldRootParent = $this->getRootParent();
|
|
||||||
if(!$oldRootParent) $oldRootParent = $this->parent;
|
|
||||||
$newRootParent = $parent->getRootParent();
|
|
||||||
if(!$newRootParent) $newRootParent = $parent;
|
|
||||||
if($oldRootParent === $newRootParent) {
|
|
||||||
// if field staying in the same form, remove from previous parent
|
|
||||||
$this->parent->remove($this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$this->parent = $parent;
|
$this->parent = $parent;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user