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

dev/core#561 Add in deprecation notice on addDateRange funtion #16863

Conversation

seamuslee001
Copy link
Contributor

Overview

Following the various work on https://lab.civicrm.org/dev/core/issues/561 this now adds in a deprecation warning on what is now considered a deprecated function which uses jcalander to render the date fields

Before

Function not deprecated

After

Function declared as deprecated

ping @eileenmcnaughton

@civibot
Copy link

civibot bot commented Mar 20, 2020

(Standard links)

@civibot civibot bot added the master label Mar 20, 2020
@seamuslee001
Copy link
Contributor Author

Jenkins re test this please

@yashodha
Copy link
Contributor

@seamuslee001
Copy link
Contributor Author

@yashodha yes am aware of that, I was wanting to try and put it as low down the stack as possible so that if anyone was using the addDateRangeToForm or buildDateRange or just did a direct $form->addDateRange it was picked up

doing a grep on those 2 function names you will see they aren't referenced at all in the code base anymore either, however it is probable that Extensions will be using them. So I guess the options are

  1. put in the deprecation notice in all the legacy functions 2) have it at the very bottom of the stack 3) just in the wrapper functions. @eileenmcnaughton any thoughts?
seamus@civicrmdevphp7:~/buildkit/build/47-test/web/sites/all/modules/civicrm$ grep -ir 'buildDateRange' *
CRM/Core/Form/Date.php:  public static function buildDateRange(
CRM/Member/BAO/Query.php:    if ($query->buildDateRangeQuery($values)) {
CRM/Case/BAO/Query.php:    if ($query->buildDateRangeQuery($values)) {
CRM/Contact/BAO/Query.php:    // @todo also handle _low, _high generically here with if ($query->buildDateRangeQuery($values)) {return}
CRM/Contact/BAO/Query.php:  public function buildDateRangeQuery($values) {
CRM/Pledge/BAO/Query.php:    if ($query->buildDateRangeQuery($values)) {
seamus@civicrmdevphp7:~/buildkit/build/47-test/web/sites/all/modules/civicrm$ grep -ir 'addDateRangeToForm' *
CRM/Core/Form/Date.php:    CRM_Core_Form_Date::addDateRangeToForm(
CRM/Core/Form/Date.php:  public static function addDateRangeToForm(

@eileenmcnaughton
Copy link
Contributor

OK - I guess we need to surface to devs that if they are using this they need to stop as it won't always work. I'm pretty sure extended reports will need a patch for this

@eileenmcnaughton eileenmcnaughton merged commit 0093854 into civicrm:master Mar 26, 2020
@eileenmcnaughton eileenmcnaughton deleted the dev_core_561_daterange_deprecation branch March 26, 2020 22:09
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