cm-advanced / civicrm_multiday_event

Link a Drupal node with 1 to many session dates to one CiviCRM event. Works well with multi session classes tied to a singe CiviCRM event tied to a single certifications
GNU General Public License v2.0
0 stars 1 forks source link

Upgrading module to work with current code versions #2

Open bcobin opened 5 years ago

bcobin commented 5 years ago

I've been upgrading sites to 7.63, Civi 5.9.1 and PHP 7.1 and run into a few things that might prove useful.

  1. The GitHub fork of the module causes an "unsupported" alert - what's worked for me is using a patched version of the latest production release using the patch from here:

https://www.drupal.org/project/civicrm_multiday_event/issues/2660706

  1. That's not enough, though - you still get the following error upon creating an event:

• Warning: Illegal string offset 'und' in drupal_array_set_nested_value() (line 6789 of /home/[site]/public_html/includes/common.inc). • Error: Cannot create references to/from string offsets in drupal_array_set_nested_value() (line 6789 of /home/[site]/public_html/includes/common.inc).

The following change in core fixes the error and now, events can be created:

https://www.drupal.org/node/2313517

But... obviously, patching core is a bad thing - if there's any way that the module can be made "safe" for later software versions, that would be great. In the meantime, perhaps this will be helpful to someone.

ericfg commented 5 years ago

the new release might fix all the issues you are talking about. please give it a test and let me know. https://github.com/cm-advanced/civicrm_multiday_event/tree/7.x-2.3

bcobin commented 5 years ago

Thank you so much for this! The old module seems to be working if I patch core, so In the old tradition of "if it ain't broke," I'll install this on my sites that use it upon the next Drupal core update, which, I'm sure will happen all too soon, sad to say. Thanks again!

bcobin commented 4 years ago

Nope. I've been patching core and finally decided to try this on a site that's virtually dormant and I got the below after replacing the module. This is on PHP 7.2 BTW. Thanks for trying...

drush updb WD php: ParseError: syntax error, unexpected '}', expecting end of file in drupal_load() (line 318 of [error] /home/[site]/public_html/sites/all/modules/civicrm_multiday_event/civicrm_multiday_event.module).

bcobin commented 4 years ago

Going through another Drupal core update, so I figured I may as well reach out again. I know that it's only 61 installs, so what can one expect? But I do use it extensively - see implementations at https://suffolkcountydems.com/events-roundup (including feed items), https://usgbc-li.org/event/calendar and https://babylonida.org/events/calendar

On Drupal 7.22 (most recent as of this post), line 2106 of includes/form.inc needs to be changed from:

drupal_array_set_nested_value($form_state['input'], $element['#parents'], NULL);

to

drupal_array_set_nested_value($form_state['input'], $element['#parents'], NULL, TRUE);

and then things work as expected, at least as far as CCMDE is concerned. The change hasn't seemed to effect site operations otherwise, but having to patch core each time to get CCMDE to work is scary.

Any guidance greatly appreciated - thanks in advance and for the module in general!

ericfg commented 4 years ago

so little time these days but I promise to put this on my to-do list so you can stop having to hack on core each time.

bcobin commented 4 years ago

Thank you SO much, Eric - most gratefully appreciated!

seascoot commented 4 years ago

@bcobin I appreciate your community mindedness in posting the patch!