Closed (fixed)
Project:
Drupal core
Version:
8.8.x-dev
Component:
render system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Nov 2019 at 22:40 UTC
Updated:
2 Dec 2019 at 15:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
stefanos.petrakisUpdated and rerolling the testing code, need it to to demonstrate before and after applying the patch.
Adding a patch as well.
Comment #3
stefanos.petrakisMissed the actuall patch.
Comment #4
stefanos.petrakisComment #7
avpadernoComment #8
avpadernoThis is quite straight. It's the same issue Drupal 7 has, and the fix is the same.
Comment #9
mcdruid commentedThanks for working on this @stefanos.petrakis - this is great!
I think the standard approach is to have a test-only patch which illustrates the problem by failing, then a patch which includes the test and the change which fixes the issue.
That's what you've provided in #2 and I think that's what we should leave as the patch we're proposing be committed.
I'll upload the patches again following the standard naming convention just for clarity, but these are @stefanos.petrakis's patches without changes.
Comment #12
mcdruid commentedOh... the test fails as a "Risky Test" even with the change. IIUC that's because it doesn't actually do anything beyond trigger the PHP Warning.
I'm trying to establish whether we should fix the test properly (there's a
@TODOcomment as well) or just remove it.Comment #13
alexpottI think we should do
$quantity = empty($variables['pager']['#quantity']) ? 0 : $variables['pager']['#quantity'];. Using(int)potentially hides helpful warning if you do actually pass a value like 'a_string_value' in.It's a risky test because it is not making an assertion. It's verifying the absence of something - there needs to be a positive assertion.
Comment #14
mcdruid commentedPer @alexpott's suggestion new patch which handles an empty #quantity specifically.
Tidied up the test and added a basic assertion.
Comment #16
fabianx commentedRTBC - Looks good to me.
Thanks, alexpott for the feedback that the original patch was better than casting to int.
Comment #17
alexpottCommitted and pushed bd584c5719 to 9.0.x and f8c7a35ac5 to 8.9.x. Thanks!
I think we should backport this to 8.8.x as per process asking another committer for a +1 because we're in beta.
Comment #20
alexpott@catch +1'd the fix.