Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

[DomCrawler] Bug #43921 Check for null parent nodes in the case of orphaned branches#59779

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:6.4fromttk:crawler-closest-orphan-fix
Feb 14, 2025

Conversation

ttk
Copy link
Contributor

@ttkttk commentedFeb 14, 2025

QA
Branch7.2
Bug fixyes
New featureno
Deprecationsno
IssuesFix#43921
LicenseMIT

This simple fix checks for null parent nodes when traversing the DOM tree when calling theclosest() function. Instead of failing, the function will return null instead. This bring it into alignment with how theancestors() function behaves (not failing on null parent nodes).

Null parent nodes can occur when a DOM branch is orphaned due to manipulations on the document, and this is a perfectly normal scenario.

Unit tests added that checks for this specific bug.

This fix should not break any backward compatibility.

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has acontribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (seehttps://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (seehttps://symfony.com/releases)
  • Features and deprecations must be submitted against the 7.3 branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@carsonbotcarsonbot changed the titleBug #43921 [DomCrawler] Check for null parent nodes in the case of orphaned branches[DomCrawler] Bug #43921 Check for null parent nodes in the case of orphaned branchesFeb 14, 2025
@ttkttkforce-pushed thecrawler-closest-orphan-fix branch 2 times, most recently fromaceaa41 to6c64c0dCompareFebruary 14, 2025 16:00
@fabpotfabpot modified the milestones:7.2,6.4Feb 14, 2025
@fabpot
Copy link
Member

Thank you@ttk.

@fabpotfabpot merged commit5c8c72b intosymfony:6.4Feb 14, 2025
5 checks passed
This was referencedFeb 26, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@fabpotfabpotfabpot approved these changes

@stofstofstof approved these changes

@lyrixxlyrixxAwaiting requested review from lyrixx

@ycerutoycerutoAwaiting requested review from yceruto

@chalasrchalasrAwaiting requested review from chalasr

@dunglasdunglasAwaiting requested review from dunglas

@OskarStarkOskarStarkAwaiting requested review from OskarStark

@jderussejderusseAwaiting requested review from jderusse

@xabbuhxabbuhAwaiting requested review from xabbuh

Assignees
No one assigned
Projects
None yet
Milestone
6.4
Development

Successfully merging this pull request may close these issues.

4 participants
@ttk@carsonbot@fabpot@stof

[8]ページ先頭

©2009-2025 Movatter.jp