This may belong with tokens or ctools, but the behavior rears itself only when panels is providing a node add form variant so I'm starting here.

My content type has several upload fields for images and files and employs tokens for the paths for the directory structure, set to include: [current-date:custom:Y] (although I've tried various other date formats, including site: prefix as well)

When a panel variant is disabled, there are no errors. When enabled and a file is uploaded, an error is printed above the field.
Notice: Undefined property: stdClass::$nid in node_tokens() (line 152 of /path/to/modules/node/node.tokens.inc).

Oddly the image appears to upload fine, rendering to the screen as a preview, and showing up in the filesystem. No errors appear when adding images/files to previously created nodes.

Comments

xbrianx’s picture

I found this post through google and I am getting pretty much the same error. When I upload images on a new node I get the following error:

Notice: Undefined property: stdClass::$nid in node_tokens() (line 112 of /home/site/public_html/testing/modules/node/node.tokens.inc).

I am also using panels to create a new node edit form.

Anonymous’s picture

Issue summary: View changes

This is still happening on 7.41 and latest panels release.

Notice: Undefined property: stdClass::$nid in node_tokens() (line 112 of..../public_html/modules/node/node.tokens.inc).

I get this notice when enabling "node/edit" from pages and add a "variant" to a content type which has:
title, body, entityreference, field-collection and decimal type of fields.

This notice is thrown multiple times when accessing node/add/mycontenttype.
The same variant is also used on node/edit => no notices.

Anonymous’s picture

Might this be somehow cache related since the notice is now gone...
Cleared the caches when this arise, but still.

I haven't made any alterations to panel variant.
My content was OG group_content so it had the 'group_audience' field in it. This field was also pre-populated from context (or url argument).
I think the notice vanished after I created a new group, can't say for sure as I kind of forgot this issue for a moment there.

Updated just if it helps anyone else. Most likely not a issue in panels.

japerry’s picture

Status: Active » Closed (outdated)

Drupal 7 is no longer supported, closing.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.