First of all, thanks to crew who worked to get the module up to date for the Google Calendar API v3! Well done, greatly appreciated.

We were able to get the module updated and pushed out and our calendars are working again. Since pushing out the latest DEV version we have noticed our watchdog logs have filled up with the following error:

Notice: Undefined property: stdClass::$hangoutlinktext in _agenda_parse_event() (line 361 of /srv/bindings/xxxxxxxxxxxxxxx/code/sites/all/modules/agenda/agenda.module).

Wasn't sure if we should have stuck this on the bottom of the other Issue (https://www.drupal.org/node/2376795) so we just created a new one.

Comments

StuddMan’s picture

gooddesignusa’s picture

try going to the agenda block settings and save the block again.

nerian79’s picture

After saving the block the error goes away. But then comes back the next time the cache is clear and the data is retrieved again.

gooddesignusa’s picture

I can't seem to reproduce the error. Before I started I made sure my error_reporting in PHP was set to E_All.
I tried clearing out the hangout link text & changing cache time to 10 seconds. Saved, ran cron, flushed cached. I also tried the same test with the default text. Not sure why it would throw a notice with this field. It's the same as the normal event link. We can wrap it in an isset() but I would like to know why it keeps getting cleared out.

Does this happen with other calendar feeds? If you make a new agenda block and set it up with the same settings does it still happen?

guschilds’s picture

Status: Active » Needs review
StatusFileSize
new2.3 KB

There are two ways to reproduce this issue:

First scenario

  1. Install and configure Agenda 7.x-2.0-beta1 from scratch.
  2. Add the example block to the page without editing/saving it.
  3. Load the page with the block on it.

Second scenario

  1. Install Agenda 7.x-1.4 from scratch.
  2. Add the example block to the page without editing/saving it.
  3. Update Agenda to 7.x-2.0-beta1. Add the library and developer key, but don't edit/save the block.
  4. Load the page with the block on it.

In both cases, the error won't appear after the first page load until cache is cleared.

The first scenario occurs because hangoutlinktext was not added to agenda_install_fixtures() within agenda.install. Doing so will solve that problem. It will not solve the second case, however, as agenda_install_fixtures() will/should not be run again when the module is upgraded. A proper update hook to solve this problem is pretty ugly. Instead, ensuring $block->hangoutlinktext exists before using it may be the safest route to take.

I've attached a patch that solves both problems. Please test against them and feel free to suggest/implement improvements.

Thanks!

Status: Needs review » Needs work

The last submitted patch, 5: agenda-undefined-hangoutlinktext-2386029-5.patch, failed testing.

Status: Needs work » Needs review

  • guschilds committed b727816 on 7.x-2.x
    Issue #2386029 by jpstuddard, guschilds: Fixed undefined hangoutlinktext...
guschilds’s picture

Status: Needs review » Fixed

I have committed this fix to the 7.x-2.x branch. It will be available in the next development release and any releases after 7.x-2.0-beta1.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.