Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

Check if ad_integration module exists, before trying to get the service #11

Open
wants to merge 2 commits into
base: 8.x-2.x
Choose a base branch
from

Conversation

tjwelde
Copy link
Contributor

@tjwelde tjwelde commented May 25, 2016

This is necessary, because we moved the ad_integration from thunder to the thunder_infrastructure, making it an optional module.

@@ -242,7 +242,7 @@ function infinite_base_get_all_parents($term) {
* Implements hook_preprocess_node().
*/
function infinite_base_preprocess_node(&$variables) {
if ($variables['view_mode'] == 'full' || $variables['view_mode'] == 'lazyloading') {
if ($variables['view_mode'] == 'full' || $variables['view_mode'] == 'lazyloading' && \Drupal::moduleHandler()->moduleExists('ad_integration')) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this check is wrong, the "&&" operator is binding stronger then the "||" operator, which results in a faulty check, it should be something like this (see additional parenthesis arround the "||" operands):
if ( ($variables['view_mode'] == 'full' || $variables['view_mode'] == 'lazyloading') && \Drupal::moduleHandler()->moduleExists('ad_integration'))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I don't know why I overlooked this. Thanks for the fix.

@stevenx stevenx force-pushed the 8.x-2.x branch 3 times, most recently from 82389e6 to 94fda4f Compare October 12, 2017 14:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants