Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PHP 7 strict warnings CRM_Core_DAO::getContactIDsFromComponent passed by reference #13295

Merged

Conversation

andrewpthompson
Copy link
Contributor

@andrewpthompson andrewpthompson commented Dec 17, 2018

Overview

This PR fixes PHP 7 strict warnings on several search task forms, i.e. creating a PDF letter after searching for Memberships or Event participants.

Before

PHP notices are displayed when the search task forms are displayed for Memberships, Event participants on PHP7+.

After

No PHP notices are displayed for those forms.

Technical Details

The e-notices were caused by this obsolete pattern; the & can be safely removed:

    $this->_contactIds = &CRM_Core_DAO::getContactIDsFromComponent($this->_memberIds,
      'civicrm_membership'
    );

It is present in

CRM/Event/Form/Task.php
CRM/Grant/Form/Task.php
CRM/Pledge/Form/Task.php
CRM/Core/Form/Task.php

and had already been resolved in:

CRM/Case/Form/Task.php
CRM/Contribute/Form/Task.php

Comments

For Pledges, Grants and Core, although the same obsolete pattern was present it does not appear to be used. I have changed these in line with Membership and Event and tested.

only variables should be passed by reference
only variables should be passed by reference
only variables should be passed by reference
only variables should be passed by reference
only variables should be passed by reference
@civibot
Copy link

civibot bot commented Dec 17, 2018

(Standard links)

@civibot civibot bot added the master label Dec 17, 2018
@andrewpthompson andrewpthompson changed the title [WIP] Fix PHP 7 strict warnings CRM_Core_DAO::getContactIDsFromComponent passed by reference Fix PHP 7 strict warnings CRM_Core_DAO::getContactIDsFromComponent passed by reference Dec 17, 2018
@mattwire
Copy link
Contributor

This is a PHP4 hangover. I've reviewed the code and confirm it is ok to merge.

@mattwire
Copy link
Contributor

ok to merge @eileenmcnaughton @seamuslee001

@JoeMurray JoeMurray merged commit 6fe426f into civicrm:master Dec 17, 2018
@andrewpthompson andrewpthompson deleted the andrewpthompson-dev-core-602 branch December 17, 2018 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants