Just like the default glossary, but implement to taxonomy terms instead of nodes.
Bug:
Fatal error: Unsupported operand types in R:\web\app\drupal\Develop-8.x\drupal-8.0.x\core\modules\views\src\ManyToOneHelper.php on line 307
The Problem:
$placeholders = array(
$placeholder => $value,
) + $this->placeholers;
$this->placeholders here is NULL.
Simple solution
$placeholders = array(
$placeholder => $value,
);
if (!empty($this->placeholders)) {
$placeholder += $this->placeholders;
}
while I don't have time to learn Views deep enough to know if all the callers that call this class object would provide value for that property("placeholders"), I don't see any default assignment before this in the file.
This should solve this issue for now and without any functionality change.
For further context-wise solution, may require Views-experts' assistance.
Comments
Comment #2
dawehnerThank you for the report!
At that point $this->placeholders is completly empty so I'm wondering whether we need this + ... at all.
Comment #3
DanGun commentedJiha, this solution worked very well for my needs. Is there a chance to get this solution into core?
Comment #4
arunkumarkHi,
I have patched for Above issue as suggested solutions.
Also this issue exist in core 8.1.x
Comment #6
sjovanig commentedPatch is working. Thanks.
Comment #7
arunkumarkHi,
patch re-rolled for supporting Druapl 8.1.x version
Comment #8
cilefen commentedHow did this become Major suddenly? Perhaps it is Major, but there was no explanation given.
Comment #10
cilefen commentedA fatal affecting certain situations is Major.
Comment #11
banacan commentedSo is the latest patch for 8.1.x working or not?
Comment #12
matthias_bauw commentedThis bug still exists in 8.1.6. Tried it on a vanilla install on simplytest.me
Comment #14
lendudeMoving the work over from #2778411: Glossary mode is not working for taxonomy in views contextual filter and closing that as a duplicate.
Fix and a test. Approach os a little different for the fix. Instead of testing for this->placeholders we just throw it out, it's not used anywhere in the entire project.
Talked to @dawehner on IRC about moving the test to dedicated many-to-one tests, except we don't have any. So leaving this as a separate test for now.
Comment #16
jhedstromThis looks good. The test properly demonstrates the current fatal error.
A few tiny nits (they could potentially be fixed on commit).
Could these use
{@inheritdoc}instead?This needs the
{@inheritdoc}docblock.Comment #17
lendude@jhedstrom thanks for the review!
1. Both @inheritdoc and the copy/paste string occur in core, no real consensus i guess. I like the inheritdoc here, it clearly indicates nothing special is happening.
2. Added.
Comment #18
dawehnerThank you
Comment #19
dawehner.
Comment #20
alexpottCommitted 33280fd and pushed to 8.3.x. Thanks!
Setting to 'patch to be ported' for cherry-pick to 8.2.x once 8.2.0 is released.
I considered the BC implications of this tiny behaviour change on commit but the property is not documented or used anywhere but here and I don't think the ManyToOneHelper is an extension point.
Fixed on commit.
Comment #22
ressaI was going to ask how to apply the patch in #2630692: Fatal error when creating taxonomy term glossary view to Drupal 8.2-RC2, since it is not included in that version.
I have now done some testing, and to answer my own question, if anyone else has this issue, one way is to define Drupal core version and the patch in a make-file like this:
Comment #24
alexpottCommitted 103a18d and pushed to 8.2.x. Thanks!
Comment #25
ressaAwesome, thank you so much @alexpott!
Comment #27
xjmCorrecting issue credit.
Comment #28
xjm