When using the "Set as anonymous front page" or "Set as authenticated front page" from the drop down in the admin content section, I get this error:

    Notice: Undefined offset: 0 in frontpage_set() (line 307 of /var/www/htlongstay.jp/htdocs/sites/all/modules/frontpage/frontpage.module).
    Notice: Trying to get property of non-object in frontpage_set() (line 313 of /var/www/htlongstay.jp/htdocs/sites/all/modules/frontpage/frontpage.module).

It seems to be that $node is not being correctly passed to this function. It would seem like quite a basic problem, so maybe something with my set up is causing this.

It's a fresh install of drupal 7. The only 3rd party modules I installed is this and it's requirements and the Locale updater.

Comments

Anonymous’s picture

I could not reproduce this issue on my test site.

I noticed, anyway, that the last update function was frontpage_update_6105(), and that a menu callback was wrongly set for a menu. I fixed both these issues.

Anonymous’s picture

Title: frontpage_set() $node not being passed » $node is not being passed to frontpage_set()

I created a new official release of the module. I suggest you to update to the latest available version of Variables API.

Anonymous’s picture

I am sorry; I didn't read well what the issue was.

The problem is when the frontpage_set() function is used as node operation. The code tries to access $node[0] (where $node is the first argument passed to a node operation), but it seems that the index 0 doesn't exist. Probably the array passed to the function uses the node ID as index; I will check this.

Anonymous’s picture

Title: $node is not being passed to frontpage_set() » frontpage_set() is expecting the wrong parameters, when used as node operation callback
Anonymous’s picture

Status: Active » Fixed

I have fixed the code, and committed it to the development snapshot. I will create a new official release the next week.

Thank you for your report.

Anonymous’s picture

For who was using the development snapshot, these are the patch to apply for the changed files: frontpage.install, frontpage.module.

Anonymous’s picture

DrupalMage’s picture

Version: 7.x-1.0-alpha2 » 7.x-1.0-alpha3
Status: Fixed » Closed (cannot reproduce)
StatusFileSize
new104.53 KB
new58.71 KB
new38.43 KB
new23.29 KB

Hello

I have basically the same error as above. I installed Variable API 7.x-2.0-alpha4 and then Frontpage 7.x-1.0-alpha3. Since I am new, I am sure I did something wrong.

I have attached four section shots and I have attached them to this email. I hope it helps.

Jesse

Anonymous’s picture

Status: Closed (cannot reproduce) » Active
mkmagu’s picture

I'm getting the same problem on this module getting this error when trying to assign an authorized user front page

Notice: Undefined offset: 0 in frontpage_set() (line 405 of /home/marem07e/public_html/candle4b.com/sites/all/modules/frontpage/frontpage.module).
Notice: Trying to get property of non-object in frontpage_set() (line 407 of /home/marem07e/public_html/candle4b.com/sites/all/modules/frontpage/frontpage.module).

robciu’s picture

I'm getting the same messages too:
Notice: Undefined offset: 0 in frontpage_set() (line 405 of F:/www/fcpoppel1/sites/all/modules/frontpage/frontpage.module).
Notice: Trying to get property of non-object in frontpage_set() (line 407 of F:/www/fcpoppel1/sites/all/modules/frontpage/frontpage.module).
Furthermore, I don't get the 2 links at the end of the node body.

ziemendorf’s picture

I'm getting the same error.

Any action on this?

halefx’s picture

Same error:

Notice: Undefined offset: 0 in frontpage_set() (line 405 of /home/novologic/sites/att/htdocs/sites/all/modules/frontpage/frontpage.module).
Notice: Trying to get property of non-object in frontpage_set() (line 407 of /home/novologic/sites/att/htdocs/sites/all/modules/frontpage/frontpage.module).

  • Frontpage 7.x-1.0-alpha3
  • Variable API 7.x-2.0-alpha10
hollyh’s picture

same

jessico’s picture

Same:

Notice: Undefined offset: 0 in frontpage_set() (line 405 of /sites/all/modules/frontpage/frontpage.module).
Notice: Trying to get property of non-object in frontpage_set() (line 407 of /sites/all/modules/frontpage/frontpage.module).

Frontpage - version = "7.x-1.0-alpha3"
Vars - version = "7.x-2.0-alpha10"

Anonymous’s picture

Same +
Fatal error: Class 'FrontpageVars' not found in /home/kennis/domains/dekenniskompenie.nl/public_html/sites/all/modules/frontpage/frontpage.install on line 42
when deinstalling

mintuz’s picture

same issue

Notice: Undefined offset: 0 in frontpage_set() (line 405 of /Applications/MAMP/htdocs/drupal_dev/sites/all/modules/frontpage/frontpage.module).
Notice: Trying to get property of non-object in frontpage_set() (line 407 of /Applications/MAMP/htdocs/drupal_dev/sites/all/modules/frontpage/frontpage.module).

Anonymous’s picture

Same issue here..

Notice: Undefined offset: 0 in frontpage_set() (line 405 of /home2/queueonc/public_html/sites/all/modules/frontpage/frontpage.module).
Notice: Trying to get property of non-object in frontpage_set() (line 407 of /home2/queueonc/public_html/sites/all/modules/frontpage/frontpage.module).

Is this something I can correct manually?
Many Thanks for your advice.

JM

aaronott’s picture

Status: Active » Needs review
StatusFileSize
new833 bytes

Looks like the function is expecting $node to be either a node object or an array of node objects. When I tried it, I found that it's actually getting an array of nids so with that, created this patch for this issue.