wbraganca / yii2-dynamicform

It is widget to yii2 framework to clone form elements in a nested manner, maintaining accessibility.
Other
436 stars 438 forks source link

Call to undefined method Symfony\Component\DomCrawler\Crawler::rewind() #108

Open jonatasfl opened 8 years ago

jonatasfl commented 8 years ago

I was using this extension 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

How to solve this?

gitxpiter commented 8 years ago

I have the same problem :-(

slow-loris commented 8 years ago

same here

fg commented 8 years ago

same

jonatasfl commented 8 years ago

An alternative solution is to get the DomCrawler back to version 2.8.
Sorry for my bad english.

fg commented 8 years ago

@jonatasfl thanks its work.

{
    "symfony/dom-crawler": "2.8",
    "symfony/css-selector": "2.8",
    "wbraganca/yii2-dynamicform": "2.0.1"
}
slow-loris commented 8 years ago

This is doing the job as well:

"wbraganca/yii2-dynamicform": "dev-master"

lexen77 commented 8 years ago

I'm receiving this error

estebanhere commented 8 years ago

where I should put the code fg or the line slow-loris?

Thank you. SOrry for my english

slow-loris commented 8 years ago

@estebanhere Search for "braganca/yii2-dynamicform" in your composer.json and replace the value with "dev-master"

estebanhere commented 8 years ago

Thank you! it works!

paulimas1202 commented 8 years ago

i still have this error..

here is my code : "require": { "php": ">=5.4.0", "yiisoft/yii2": "", "yiisoft/yii2-bootstrap": "", "yiisoft/yii2-swiftmailer": "", "yiisoft/yii2-jui": "", "wbraganca/yii2-dynamicform": "dev-master", "kartik-v/yii2-widget-datepicker": "@dev", "kartik-v/yii2-krajee-base": "dev-master", "kartik-v/yii2-grid": "@dev", "kartik-v/yii2-editable": "", "kartik-v/yii2-widgets": "@dev", "kartik-v/yii2-mpdf": "@dev", "kartik-v/yii2-datecontrol": "@dev", "mdmsoft/yii2-autonumber": "", },

what should i do, please give me any suggestion. Thank you so much.

choerulafifanto commented 8 years ago

@paulimas1202 try to composer update

JennyGamez commented 7 years ago

Hello, I was presented with the same problem, I have already done everything you have described in this forum, but still the problem is present, I need help, Thank you

geriadam commented 7 years ago

i have same problem, how i fix this ?

mmodabashi commented 6 years ago

Changing this: "wbraganca/yii2-dynamicform": "dev-master" in composer.json, then composer update in terminal fixed for me.

Edit: Actually doing so broke other forms in the view. I have no idea what happned!

Edit 2: That worked fine at the end: "symfony/dom-crawler": "2.8", "symfony/css-selector": "2.8", "wbraganca/yii2-dynamicform": "2.0.1",

noimo95 commented 5 years ago

Changing this: "wbraganca/yii2-dynamicform": "dev-master" in composer.json, then composer update in terminal fixed for me.

Edit: Actually doing so broke other forms in the view. I have no idea what happned!

Edit 2: That worked fine at the end: "symfony/dom-crawler": "2.8", "symfony/css-selector": "2.8", "wbraganca/yii2-dynamicform": "2.0.1",

This not work for me. Already change the version but it still the same.

yusufsupriatna commented 5 years ago

same aing oge,,

minitia commented 5 years ago

I had the same problem today, with a DynamicFormWidget with 'min' => 0 that give me the error:

Call to undefined method Symfony\Component\DomCrawler\Crawler::rewind()

  1. in C:\blablabla\vendor\wbraganca\yii2-dynamicform\DynamicFormWidget.php at line 201

I solved downgrading as you suggest "symfony/dom-crawler": "2.8", "symfony/css-selector": "2.8",

with composer require "symfony/dom-crawler:2.8" composer require "symfony/css-selector:2.8"

So I think it is better to change the dependencies on the extension composer file, specifying the version 2.8 because now is "require": { "yiisoft/yii2": "", "symfony/dom-crawler": "", "symfony/css-selector": "*" },

Potomac commented 5 years ago

Hello,

in july 2019 this bug is still here, the workaround found in 2015 (using "dev-master" for dynamic-form and downgrading symphony/dom-crawler and symphony/css-selector to an older version) may not work in a future

Package operations: 0 installs, 3 updates, 0 removals

  • Downgrading symfony/dom-crawler (v4.3.2 => v3.4.29): Downloading (100%)
  • Downgrading symfony/css-selector (v4.3.2 => v3.4.29): Downloading (100%)
  • Removing wbraganca/yii2-dynamicform (v2.0.2)
  • Installing wbraganca/yii2-dynamicform (dev-master 75c4271): Cloning 75c4271d85 from cache

A better solution is to make yii2-dynamicform compatible with the last version of symfony/dom-crawler, by solving this error in the source code of yii2-dynamicform :

Call to undefined method Symfony\Component\DomCrawler\Crawler::rewind()

The error is pointing to the line 201 of /vendor/wbraganca/yii2-dynamicform/DynamicFormWidget.php

RastislavBr commented 5 years ago

Hello, I fixed this problem.

291

jacksontong commented 5 years ago

@slow-loris you've saved my day