CRM-19431 The empty array that it's not really empty

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.6.21
    • Fix Version/s: 4.6.24, 4.7.14
    • Component/s: None
    • Documentation Required?:
      Developer Doc
    • Funding Source:
      Contributed Code

      Attachments

        Activity

        [CRM-19431] The empty array that it's not really empty
        Coleman Watts added a comment -

        Thanks for filing this and working on a fix. Can you please submit your change to the master branch first and then we can look at backporting it to LTS?

        Dave Jenkins added a comment - - edited

        I ran into the same issue. A 4.6.21 site was throwing a fatal error on Basic Search form, "Cannot recognize 0 for 2". I tracked this down to CRM/Contact/BAO/ContactType.php basicTypeInfo() passing CRM_Core_DAO::$_nullArray to CRM_Core_DAO::executeQuery, where CRM_Core_DAO::$_nullArray is not empty but has 23 elements, which appear to be tag id => tag name for a subset of the tags.
        Haven't been able to replicate on demo. The backtrace involves Views, in my case.

        Created PR https://github.com/civicrm/civicrm-core/pull/9376 . This is similar to Ruben's patch here, the differences being...
        1. I found Ruben's patch gave a strict warning "Only variables should be passed by reference", due to using ''$nullArray = array()" as an argument in a function call.
        2. I decided on a belt-and-braces approach, fixing both the pollution (in EntityTag) and use (in ContactType) of CRM_Core_DAO::$_nullArray.

        Dave Jenkins added a comment -

        Thanks, Coleman Watts for merging the PR against master. Would be good to get the fix in 4.6, shall I create another PR against 4.6?

        Coleman Watts added a comment -

        Yes please.

          People

          • Assignee:
            Unassigned
            Reporter:
            Ruben Pineda

            Dates

            • Created:
              Updated:
              Resolved: