1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-23 23:02:58 +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:
Ryan Cramer
2018-08-08 06:21:01 -04:00
parent 6d1dc83a45
commit cee8504db9

View File

@@ -492,16 +492,6 @@ abstract class Inputfield extends WireData implements Module {
*
*/
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;
return $this;
}