I think PHP 5.4 now throws warnings/noticed when arrays are unexpectedly converted to strings. Looks like we have a few tests which are broken...
I haven't checked all of them, but this is the list that failed with exceptions when running tests with my patch from #1187726: Add caching for configuration / rework config object loading (Was: Memory usage and i/o from config objects) locally. Tried config import and contact tests and both were because of this. Others, especially those with fails too might be related to the other issue but need to be checked.
Import configuration 38 passes, 0 fails, and 20 exceptions
Import UI 45 passes, 1 fail, and 12 exceptions
Site-wide contact form 240 passes, 4 fails, and 7 exceptions
Entity Test Translation UI 68 passes, 0 fails, and 22 exceptions
Module dependencies 137 passes, 26 fails, and 2 exceptions
Node translation UI 106 passes, 0 fails, and 18 exceptions
Enable/disable modules 1149 passes, 620 fails, and 60 exceptions
Taxonomy term translation UI 99 passes, 0 fails, and 22 exceptions
Tracker 228 passes, 0 fails, and 2 exceptions
Field: Base 206 passes, 0 fails, and 1 exception
Cache 12 passes, 0 fails, and 18 exceptions
Handler test 110 passes, 0 fails, and 28 exceptions
Row: UI 28 passes, 2 fails, and 1 exception
Style: UI 28 passes, 2 fails, and 1 exception
Tag 23 passes, 0 fails, and 8 exceptions
the category tests are obvious:
watchdog('contact', 'Category %label has been updated.', array('%label' => $category->label()), WATCHDOG_NOTICE, l(t('Edit'), $category->uri() . '/edit'));
$category->uri() returns an array...
Comment | File | Size | Author |
---|---|---|---|
#7 | php54-warnings-1854540-7-foreach.patch | 3.86 KB | Berdir |
#7 | php54-warnings-1854540-7-array-filter.patch | 3.8 KB | Berdir |
#6 | php54-warnings-1854540-6.patch | 3.8 KB | Berdir |
#5 | php54-warnings-1854540-5.patch | 2.93 KB | Berdir |
#1 | php54-warnings-1854540-1.patch | 3.8 KB | Berdir |
Comments
Comment #1
BerdirOk, first patch.
This fixes the following from the list above:
All trivial and kinda fun stuff ;)
These are a bit more involving:
They throw notices because we pass nested arrays to array_diff_assoc(), something that it doesn't support, see: http://ch1.php.net/array_diff_assoc: "Note: This function only checks one dimension of a n-dimensional array. Of course you can check deeper dimensions by using, for example, array_diff_assoc($array1[0], $array2[0]);.". What it doesn't say is that it throws a warning when you do. Not sure what to do with these?
These are fixed in #1831530: Entity translation UI in core (part 2):
These actually don't seem to have failures without the cache storage chain patch, so can be Ignored I think.
Which leaves us with the array_diff_assoc() problem... That might even indicate possible actual bugs?
Comment #2
BerdirThis one is awesome.
This was changed back in 2009 when fields were converted to a field (yes, I had to check). And then, we forgot to change it back when this was reverted because it didn't fail, just converted this to "Array". Nothing that unusual, happens.. The fun part about is that we changed the constant twice without noticing ;)
Comment #3
BerdirActually, Handler test fails as well, with this:
Comment #4
catchBumping to critical, while we don't have PHP 5.4 on the test bots lots of people develop locally with that.
Comment #5
BerdirInteresting, looks like the recent views changes fixed some of the views specific exceptions, like the Cache ones.
Also, there is now #1856546: config import should use array_diff_key that should take care of the config import related ones.
I've executed all views tests in the UI (yes, this is now actually a doable tasks thanks to the test performance improvements!) and fixed the remaining test failures.
I'm not 100% sure if the array_filter code in views_ui/admin.inc is correct, someone from the views team should probably have a look at it, not sure how good the test coverage there is.
Comment #6
BerdirUh, wrong patch.
Comment #7
BerdirDiscussed with @timplunkett that doing a foreach and just replacing the method might be easier to understand but we weren't sure if there is always a standardSubmit that can be replaced.
Patch in #6 needed a re-roll anyway, so here is one version with foreach and one with array_filter(). Both seem to pass the tests, whatever that means.
Comment #8
xmacinfo@Berdir: This bug #1859536: Testing/Aggregator module warning: Requirements check comparison output two 'strings' (cURL) as an array may be related; string comparison for requirements shows a warning when the cURL comparison encounters an array.
Comment #9
dawehnerThis is so much better then before! In general array_filter() seems to easier to understand then foreach(
Comment #10
Dries CreditAttribution: Dries commentedCommitted to 8.x. Thanks.