yii2-dynamicform icon indicating copy to clipboard operation
yii2-dynamicform copied to clipboard

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

Open cscrewsandcaptains opened this issue 2 years ago • 7 comments

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"

cscrewsandcaptains avatar Apr 28 '22 07:04 cscrewsandcaptains

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

gthaka avatar Aug 02 '22 13:08 gthaka

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()"

charmy93 avatar Nov 04 '22 16:11 charmy93

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###

  • "codeception/module-filesystem": "^2.0 || ^1.1",
  • "symfony/browser-kit": "^6.0 || >=2.7 <=4.2.4"

###To###

  • "codeception/module-filesystem": "^3.0 || ^1.1",
  • "symfony/browser-kit": "^6.2 || >=2.7 <=4.2.4"

bugToaster avatar Mar 21 '23 09:03 bugToaster

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 avatar Mar 21 '23 11:03 cscrewsandcaptains

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

cscrewsandcaptains avatar Mar 21 '23 11:03 cscrewsandcaptains

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

bugToaster avatar Mar 21 '23 11:03 bugToaster

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

cscrewsandcaptains avatar Mar 21 '23 12:03 cscrewsandcaptains