Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-45701

Behat failing because of changes in symfony/DomCrawler

    Details

    • Affected Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE, MOODLE_27_STABLE

      Description

      With following commit in symfony/DomCrawler, behat started failing.
      https://github.com/symfony/DomCrawler/commit/5e8ad4367af467b9e40d6bb27d58a76a87cebb79

      Following error is being thrown:

      PHP Warning:  DOMXPath::query(): Invalid expression in /var/lib/jenkins/git_repositories/MOODLE_26_STABLE/vendor/symfony/dom-crawler/Symfony/Component/DomCrawler/Crawler.php on line 832
      
      

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            rajeshtaneja Rajesh Taneja added a comment -

            FYI: Only non-JS behat scenarios are failing.

            Show
            rajeshtaneja Rajesh Taneja added a comment - FYI: Only non-JS behat scenarios are failing.
            Hide
            rajeshtaneja Rajesh Taneja added a comment - - edited

            Mink/Selector/NamedSelector.php use ..//label for xpath, which was not handled by the fix in domcrawler.

            Fixing xpath in crawler works fine:
            Add following expression substitution in Symfony\Component\DomCrawler\Crawler::relativize()

            elseif (0 === strpos($expression, './/')) {
                $expression = 'self::' . substr($expression, 3);
            } 
            

            Show
            rajeshtaneja Rajesh Taneja added a comment - - edited Mink/Selector/NamedSelector.php use ..//label for xpath, which was not handled by the fix in domcrawler. Fixing xpath in crawler works fine: Add following expression substitution in Symfony\Component\DomCrawler\Crawler::relativize() elseif (0 === strpos($expression, './/')) { $expression = 'self::' . substr($expression, 3); }
            Hide
            rajeshtaneja Rajesh Taneja added a comment -
            Show
            rajeshtaneja Rajesh Taneja added a comment - Aha, this has been reported https://github.com/symfony/symfony/pull/10987
            Hide
            rajeshtaneja Rajesh Taneja added a comment -

            I am closing this issue, as nothing much can be done on this, except changing composer.json to refer 2.4.4 version.

            This will be done by MDL-45698, so closing this as deferred.

            Show
            rajeshtaneja Rajesh Taneja added a comment - I am closing this issue, as nothing much can be done on this, except changing composer.json to refer 2.4.4 version. This will be done by MDL-45698 , so closing this as deferred.

              People

              • Assignee:
                rajeshtaneja Rajesh Taneja
                Reporter:
                rajeshtaneja Rajesh Taneja
                Participants:
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: