Bug #8846

AbstractXmlParserTest dies with a PHP error

Added by Bastian Waidelich about 5 years ago. Updated almost 5 years ago.

Status:Resolved Start date:2010-07-13
Priority:Must have Due date:
Assigned To:Karol Gusak % Done:

100%

Category:I18n
Target version:TYPO3 Flow Base Distribution - 1.0 alpha 11
PHP Version: Complexity:
Has patch: Affected Flow version:

Description

The unit test AbstractXmlParserTest::throwsExceptionWhenBadFilenameGiven() dies with following PHP error on my machine (Win 7, PHP 5.3):

C:\[...]\flow3\Packages\Framework\FLOW3\Classes\Locale\Xml\AbstractXmlParser.php:88
Warning: simplexml_load_file() [<a href='function.simplexml-load-file'>function.simplexml-load-file</a>]: I/O warning : failed to load external entity &quot;foo&quot; in C:\[...]\flow3\Packages\Framework\FLOW3\Classes\Locale\Xml\AbstractXmlParser.php line 88

Associated revisions

Revision 35ba32d6
Added by Karol Gusak about 5 years ago

[+BUGFIX] FLOW3 (Locale): Fixed warning when bad filename given in AbstractXmlParser. Resolves #8846.

Revision de0434bb
Added by Karol Gusak about 5 years ago

[+BUGFIX] FLOW3 (I18n): Fixed warning when bad filename given in AbstractXmlParser (again). Resolves #8846.

History

#1 Updated by Karol Gusak about 5 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Applied in changeset r4850.

#2 Updated by Bastian Waidelich about 5 years ago

  • Status changed from Resolved to Needs Feedback

Hi Karol,

I'm still getting the PHP Warning in the FLOW3 Testrunner, don't you?
Besides, we're trying to avoid the Error Control Operator (@) in FLOW3 as it's bad practice and error prone.
Instead it might help to check, whether the target filename exists before calling simplexml_load_file().
If that is not enough to prevent the error, you can call most SimpleXML functions with an LIBXML_NOERROR option (see http://de2.php.net/simplexml_load_file)

#3 Updated by Karol Gusak about 5 years ago

  • Status changed from Needs Feedback to Resolved

Applied in changeset r4859.

#4 Updated by Karol Gusak about 5 years ago

Uhm no I'm not getting any warning, maybe a misconfiguration.

Thank you for advices! Also, I saw the Error Control Operator somewhere in the code (can't remember where though).

I hope it is OK now.

#5 Updated by Bastian Waidelich about 5 years ago

Karol Gusak wrote:

Uhm no I'm not getting any warning, maybe a misconfiguration.

Strange. Anyways, it works now for me, thanks!

Also, I saw the Error Control Operator somewhere in the code (can't remember where though).

That's possible.. It's pretty hard to find the occurences via search & replace..
But I've added a ticket #8864 so it might be added to the CGL soon.

#6 Updated by Karsten Dambekalns about 5 years ago

  • Target version set to 1.0 alpha 11

Also available in: Atom PDF