Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[DomCrawler] Fixed filterXPath() chaining loosing the parent DOM nodes #10935

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

stof
Copy link
Member

@stof stof commented May 18, 2014

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #10206
License MIT
Doc PR n/a

This is a fixed version of #10207, preserving the BC for XPath queries.

The example given in #10260 when reporting the regression in the previous attempt is covered by the new tests added in the first commit of the PR.
I also added many tests ensuring that the behavior is the same than in the current implementation.

@stof
Copy link
Member Author

stof commented May 18, 2014

Given that the previous attempt was broken and I was not sure about the actual impact of the change, I worked based on the master branch rather than on 2.3. However, if we decide that this bugfix should be applied to the LTS (which would be fine) and are confident enough that it does not break things (I'm sure it works for the CSS filter and for the Crawler accessors now, but someone could have written a totally crazy XPath query not catched by the tests I added), it should be easy to apply these changes in 2.3 instead given that there is not much differences between both branches.

Note that I intentionally kept my own work split into 2 commits: 1 adding tests on the existing code before the refactoring and 1 finishing the refactoring. The new tests have much less value if we merge them in the same commit than the refactoring as it would make it hard to run them against the previous codebase, while it is their goal.

@stof
Copy link
Member Author

stof commented May 18, 2014

Please don't merge it yet. I found another case which gets broken here (using this new version with Mink)

@stof
Copy link
Member Author

stof commented May 18, 2014

OK, this is fixed

@fabpot
Copy link
Member

fabpot commented May 21, 2014

Merging it into 2.3 seems like a good idea. Can you reopen a PR on 2.3? Thanks.

@stof
Copy link
Member Author

stof commented May 21, 2014

new PR is sent

fabpot added a commit that referenced this pull request May 21, 2014
…nt DOM nodes (stof, robbertkl)

This PR was merged into the 2.3 branch.

Discussion
----------

[DomCrawler] Fixed filterXPath() chaining loosing the parent DOM nodes

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #10206
| License       | MIT
| Doc PR        | n/a

This is a fixed version of #10207, preserving the BC for XPath queries. It is the rebased version of #10935 targetting 2.3

The example given in #10260 when reporting the regression in the previous attempt is covered by the new tests added in the first commit of the PR.
I also added many tests ensuring that the behavior is the same than in the current implementation.

Commits
-------

80438c2 Fixed the XPath filtering to have the same behavior than Symfony 2.4
711ac32 [DomCrawler] Fixed filterXPath() chaining
8f706c9 [DomCrawler] Added more tests for the XPath filtering
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.