Skip to content

Fix Error in Ods.php Reader for some files #1137

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 2 commits into from
Closed

Conversation

cqix
Copy link

@cqix cqix commented Aug 12, 2019

#804 Catch Uncaught Error Call to undefined method DOMText::hasAttributeNS() in Ods.php Reader

This is:

- [x] a bugfix
- [ ] a new feature

Checklist:

Why this change is needed?

Some ODS files have a childNode of type DOMText, instead of DOMElement only. This tiny fix allows to read these files.

cqix added 2 commits August 12, 2019 18:53
Catch Uncaught Error Call to undefined method DOMText::hasAttributeNS() in Ods.php Reader
Copy link
Author

@cqix cqix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Style only

@cqix cqix marked this pull request as ready for review August 12, 2019 18:06
Copy link
Member

@PowerKiKi PowerKiKi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of loosely testing the existence of a method, it would be best to accurately test the expected type of child, and also extract DomElement specific code into a private method, to make it easier to understand what's going on.

Also tests and changelog would be nice too.

@cqix
Copy link
Author

cqix commented Sep 3, 2019

Instead of loosely testing the existence of a method, it would be best to accurately test the expected type of child, and also extract DomElement specific code into a private method, to make it easier to understand what's going on.

Also tests and changelog would be nice too.

Yes, that whole code is a little complicated to read. I did not event find out what the rest of the code was dooing, so I catched for the obvious.
Anyways, I also want to push some other stuff soon (NamedRanges for ODS Writer), but I need to find some time for tests etc before.

@stale
Copy link

stale bot commented Nov 2, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If this is still an issue for you, please try to help by debugging it further and sharing your results.
Thank you for your contributions.

@stale stale bot added the stale label Nov 2, 2019
@stale stale bot closed this Nov 9, 2019
@rsevero
Copy link

rsevero commented Feb 2, 2021

Faced the same Uncaught Error Call to undefined method DOMText::hasAttributeNS() in Ods.php Reader during some imports.

Applied the fix provided at #1137 (comment) and my imports are working again.

@oleibman
Copy link
Collaborator

oleibman commented Jul 4, 2024

Superseded by PR #4087.

@oleibman oleibman removed the stale label Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants