Hello.
I'm getting the following error after updating the module to the actual version:

Notice: Undefined index: media in flickr_block_view() (linea 259 di /mywebsite/sites/all/modules/flickr/block/flickr_block.module).

It appears every time I load a page. The module seems to work however (didn't try with movies). It seems that when "media" variable isn't defined in the flickr module code of a page, that error is shown

Thank you
Kinmen

Comments

kinmen’s picture

Hi.
I think that error is due to missing value vor variable media in the old flickr blocks. In the old Flickr module media didn't exist, and now, after the update, the module looks for it in the API code inserted in teh pages. Is that correct? It could be maybe solved by assigning a default value 'photos' when the variable is empty, or there's a better solution...

k.

lolandese’s picture

In the old Flickr module media didn't exist, and now, after the update, the module looks for it in the API code inserted in the pages.

Good guess. I am struggling with the connection here. Once back online I'll have a look.

As a temporary workaround, can you recreate the block?

Thanks.

lolandese’s picture

Title: flickr_block.module » Undefined index error after upgrade
Component: Code » flickr_block

Hi kinmen,

Thanks for reporting. I replicated an upgrade with the block 'Recent photos' being configured and rendered. I confirm the issue.

It is easily fixed by re-saving the block settings. The error message disappears. This is the advice for others running into the same issue.

Leaving this issue active as it is not solved but has an easy fix. Furthermore I have added a note on the project page.

Thanks again.

kinmen’s picture

Hi
Thank you for the fix, I confirm it works for me.

Thank you for your time & work
Kinmen

lolandese’s picture

Category: Bug report » Task
Issue summary: View changes

Moving this to 'Task' as the module itself works as intended and the upgrade issue has an easy 'work-around' fix.

lolandese’s picture

Priority: Minor » Normal
Status: Active » Needs review
StatusFileSize
new4.81 KB

In preparation for a 7.x-1.6 release. Patch makes an upgrade from 7.x-1.0 to 7.x-1.x going smooth for all blocks. No more undefined index errors.

To test for a 7.x-1.5 to 7.x-1.x upgrade.

  • Commit 93135bb on 7.x-1.x by lolandese:
    Issue #2089575 by kinmen: Upgrade script in flickr.install mainly to...
lolandese’s picture

Separated the two issues as they are unrelated. The upgrade script seems to correctly create missing index keys on the block variable arrays.

http://cgit.drupalcode.org/flickr/commit/?id=93135bb

lolandese’s picture

Status: Fixed » Needs review
StatusFileSize
new7.69 KB

As the upgrade script touches indexes on block variables, it should live in the install file of the Flickr Block module instead of the main module.

Furthermore made the block descriptions in the admin UI a bit more logical.

lolandese’s picture

Status: Needs review » Fixed
StatusFileSize
new15.7 KB

Also the creation of the vocabulary flickr_tags could be included in the upgrade. Furthermore avoiding undefined index for 'gallery' and some other minor UX improvements.

Off topic:
While testing the upgrade we bumped into this apparently and hopefully temporary Flickr API bug:
https://www.flickr.com/groups/api/discuss/72157645030438164/#
It impacts user blocks and filter tags with Flickr tags. The temporary workaround is to set the filter to 'relevant' which seems to make it work "as normal".

  • Commit c1fc15c on 7.x-1.x by lolandese:
    Issue #2089575 by kinmen: As the upgrade script touches indexes on block...

Status: Fixed » Closed (fixed)

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