Details

    • Type: Bug
    • Status: Open
    • Priority: Trivial
    • Resolution: Unresolved
    • Affects Version/s: 4.7.6
    • Fix Version/s: Unscheduled
    • Component/s: None
    • Labels:
      None
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Needs Funding

      Description

      There is expression in file CRM/Report/Form/Instance.php:

      $config->userFramework != 'Joomla' || $config->userFramework != 'WordPress'

      but it always true.

      if $config->userFramework is 'Joomla' then expression ($config->userFramework != 'WordPress') is true, so whole expression is true.

      if $config->userFramework is 'WordPress' then expression ($config->userFramework != 'Joomla') is true, so whole expression is true.

      if $config->userFramework is 'someOtherCMS' then expression ($config->userFramework != 'Joomla') is true, so whole expression is true.

      Probably you should use operator "&&" instead of "||"

      Github link: https://github.com/civicrm/civicrm-core/blob/bf09d75109e808e55f12a26aea3474ccfb31b864/CRM/Report/Form/Instance.php#L123

      Similar code section:

      1) CRM/Event/Form/Registration.php:
      {{ if ($this->_contributeMode != 'checkout' ||
      $this->_contributeMode != 'notify'
      )}}
      https://github.com/civicrm/civicrm-core/blob/bf09d75109e808e55f12a26aea3474ccfb31b864/CRM/Event/Form/Registration.php

      2) CRM/Report/Form/Activity.php:
      ($op != 'nnll' || $op != 'nll')
      https://github.com/civicrm/civicrm-core/blob/bf09d75109e808e55f12a26aea3474ccfb31b864/CRM/Report/Form/Activity.php#L583

      3) CRM/Contact/Import/Parser/Contact.php:
      ($name !== 'phone_type_id' || $name !== 'provider_id')
      https://github.com/civicrm/civicrm-core/blob/bf09d75109e808e55f12a26aea3474ccfb31b864/CRM/Contact/Import/Parser/Contact.php#L1927

      4) CRM/Contribute/Form/Contribution/ThankYou.php:
      ($name != 'onbehalf' || $name != 'honor')
      https://github.com/civicrm/civicrm-core/blob/bf09d75109e808e55f12a26aea3474ccfb31b864/CRM/Contribute/Form/Contribution/ThankYou.php#L220

      5) CRM/Custom/Form/Option.php:
      $fields["value"] != '1' || $fields["value"] != '0'
      https://github.com/civicrm/civicrm-core/blob/bf09d75109e808e55f12a26aea3474ccfb31b864/CRM/Custom/Form/Option.php#L351

      These possible defects found by static code analyzer AppŠ”hecker (http://cnpo.ru/en/solutions/appchecker.php)

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              AppChecker AppChecker
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: