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

dom-crawler bug with PHP 8.1: please use a newer version #325

Open cscrewsandcaptains opened 2 years ago

cscrewsandcaptains commented 2 years ago

Please add "|~4.4" to the composer.json entries of the required symfony packages: "symfony/css-selector":"~2.8|~3.0|~4.4", "symfony/dom-crawler": "~2.8|~3.0|~4.4" Because 4.4 is the last version that get bugfixes. There is a bug in the 3.0 version of dom-crawler, so your control cannot be used with PHP 8.1.

A workaround for my own project is to add this to composer.json: "symfony/css-selector": "4.4.37 as 3.0.0", "symfony/dom-crawler": "4.4.39 as 3.0.0"

gthaka commented 2 years ago

Same issue as @cscrewsandcaptains. was able to bypass the error using @cscrewsandcaptains workaround. Thanks

charmy93 commented 2 years ago

Trying to resolve this issue for php8, ran into another error after making above changes to composer file "Call to undefined method Symfony\Component\DomCrawler\Crawler::rewind()"

bugToaster commented 1 year ago

In order to solve the issue with Symfony DOM Crawler, I resolved it by changing the version of the main composer package in the following manner in composer.json file:

From

To

cscrewsandcaptains commented 1 year ago

My suggestion to add "symfony/css-selector":"~2.8|~3.0|~4.4", "symfony/dom-crawler": "~2.8|~3.0|~4.4" (what Discomania have done in the fix) doesn't resolve the issue. A downgrade to 3.4.47 of symfony/dom-crawler and symfony/css-selector will be done, if I remove my workaround ("symfony/css-selector": "4.4.37 as 3.0.0", "symfony/dom-crawler": "4.4.39 as 3.0.0") in my composer.json and then an exception will thrown if using the control. Sorry I have no other suggestion. I use my workaround again.

cscrewsandcaptains commented 1 year ago

@bugToaster: I have no "codeception/module-filesystem" or "symfony/browser-kit" line in my composer.json.

bugToaster commented 1 year ago

I got the above packages when creating a project from yii template (eg. advance). can you try the above packages & let's see what happens? Screenshot from 2023-03-21 17-30-11

cscrewsandcaptains commented 1 year ago

I have not install this packages ("composer show"). So there is no need for me to install them.