I ran into a weird issue, and I don't know exactly why its happening, but in debugging, I could see at types, $type was equal to the 0 integer.
You can see that example in the attached screenshot.
This was causing me issues during Search API indexing, as apparently it does some token stuff during that process. Anyways, the fix in my case was to change the comparison operator from != to !== in
if ($type != 'config_page') {
return $replacements;
}
to
if ($type !== 'config_page') {
return $replacements;
}
I'm thinking there is some comparison issue with the $type being 0, which also means FALSE. Not really sure, but this simple change allowed the indexing to complete successfully, and I also see the Config Page tokens are still generated.
It seems like from debugging, that when the token generation stuff is run, it calls to ConfigPages::config(), passing in the $type.
With the $type of 0 (zero), I believe the logic is confused too and fails on line 196:
$conditions['context'] = $type->getContextData(TRUE);
Because $type is a string, not an object. So, there may be more work needed or a better way of handling this overall, but the simple operator fix lets is pass in my case.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3302102-config-pages-comparison-operator.patch | 495 bytes | joshua.boltz |
| Screen Shot 2022-08-04 at 4.35.28 PM.png | 237.42 KB | joshua.boltz |
Issue fork config_pages-3302102
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
joshua.boltz commentedComment #3
joshua.boltz commentedComment #7
shumer commented