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

Installing kills my site #7

Closed
Egmund opened this issue Mar 3, 2022 · 11 comments
Closed

Installing kills my site #7

Egmund opened this issue Mar 3, 2022 · 11 comments

Comments

@Egmund
Copy link

Egmund commented Mar 3, 2022

After (attempt to) install I get:
Call to a member function get_option() on null
and site is dead.
There must be a conflict with something. Fullcalendar - the 'old' one?
I will investigate further, but for now I will restore my site from backup.

This is not my test site, but a live one unfortunately.

@Egmund
Copy link
Author

Egmund commented Mar 3, 2022

I cloned the site, uninstalled (old) fullcalendar, installed the new fullcalendar-views (& dependencies).
Now fine. Conflict w. the 'old' FC

@indigoxela
Copy link
Member

Ooops, right, I could confirm that.

But I don't understand what happens.

The problem arises in this function of fullcalendar (legacy):

function fullcalendar_views_query_alter(&$view, &$query) {
  if ($view->display_handler->get_option('style_plugin') != 'fullcalendar') {
    return;
  }

  $query->distinct = TRUE;
}

A quick trick to get the site working again is to insert a return; right at the beginning of that function. Then uninstalling is possible.

No clue, why display_handler is NULL at that point.

@indigoxela
Copy link
Member

indigoxela commented Mar 4, 2022

And there's also:

Warning: Creating default object from empty value in fullcalendar_views_query_alter() (.../modules/fullcalendar/includes/views/fullcalendar.views.inc).

@laryn any clue, what's going on there?

The style plugins have different names, so that can't be the cause.

@indigoxela
Copy link
Member

indigoxela commented Mar 4, 2022

OMG...

Fullcalendar legacy implements hook_views_query_alter.

Now a module fullcalendar_views exists, so this hook gets interpreted as hook_query_alter, which is a complete different one.

$view doesn't exist there.

I might be necessary to completely rename this module here, to prevent further conflicts.

On the other hand, fullcalendar legacy could catch all problems with a little isset(). I'll try that, too.

@Egmund
Copy link
Author

Egmund commented Mar 4, 2022

We do, though, not need both.
Quick & dirty: A warning before install this module to remove the 'legacy'/'old' module.
Better : This module's install will check for 'legacy' and either remove that or - at least - stop installing with a warning to uninstall 'legacy' (old) module.

@indigoxela
Copy link
Member

A warning before install this module to remove the 'legacy'/'old' module.

I wouldn't know how. The module isn't installed yet, so it can't execute any code, also no warnings.

This module's install will check for 'legacy' and either remove that or - at least - stop installing

Too late. The site seems to break immediately when trying to install fullcalendar_views, already in the "confirm" step. Not sure if it's possible to catch anything in that step.

So I'm waiting for some feedback by @laryn, if he wants to do a isset to catch the problem in the legacy module. Otherwise we really might have to rename this module.

@Egmund
Copy link
Author

Egmund commented Mar 4, 2022

A warning in the 'readme'?

@indigoxela
Copy link
Member

indigoxela commented Mar 4, 2022

A warning in the 'readme'?

Sure, that's the first step: https://github.com/backdrop-contrib/fullcalendar_views#known-issues

@indigoxela
Copy link
Member

@laryn is our hero - he merged the isset() PR!

@laryn
Copy link
Member

laryn commented Mar 4, 2022

I also renamed the other one (not the namespace but the label): FullCalendar (Legacy version) and included this in the README:

NOTE: For a more recent version of FullCalendar and support for a wider range of date fields, you may wish to look into the more recent FullCalendar Views module.

@Egmund
Copy link
Author

Egmund commented Mar 4, 2022

Very good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants