I was using the Yii2 DynamicForms extension to create dynamic fields without problems, but today when I run composer update i'm receiving the following error:
Call to undefined method Symfony\Component\DomCrawler\Crawler::rewind()
The error is pointing to the line 201 of /vendor/wbraganca/yii2-dynamicform/DynamicFormWidget.php
:
private function removeItems($content)
{
$document = new \DOMDocument('1.0', \Yii::$app->charset);
$crawler = new Crawler();
$crawler->addHTMLContent($content, \Yii::$app->charset);
$root = $document->appendChild($document->createElement('_root'));
$crawler->rewind(); // Error here
$root->appendChild($document->importNode($crawler->current(), true));
$domxpath = new \DOMXPath($document);
$crawlerInverse = $domxpath->query(CssSelector::toXPath($this->widgetItem));
foreach ($crawlerInverse as $elementToRemove) {
$parent = $elementToRemove->parentNode;
$parent->removeChild($elementToRemove);
}
$crawler->clear();
$crawler->add($document);
return $crawler->filter('body')->eq(0)->html();
}
This method was removed from DomCrawler?
How to solve this?