CommentFileSizeAuthor
lang.patch1.36 KBfgm

Comments

MichaelCole’s picture

lang.patch queued for re-testing.

JeremyFrench’s picture

I have just come across this problem while programmatically creating nodes with a path. The node saves with no language '' and the path saves with LANGUAGE_NONE. This meant that the alias was not being set correctly.

Would it be a better approach to set the default language in node_schema() to be LANGUAGE_NONE?

thedavidmeister’s picture

Issue summary: View changes
Status: Needs review » Needs work

I don't think nodes are supposed to have an empty string for a language, ever.

What would it mean to simultaneously have a LANGUAGE_NONE constant and also "no language", what's the difference? when would I want to use one and not the other.

It sounds like there's a bug elsewhere leading to nodes without a language string being created, and so we need some steps to reproduce this.

@JeremyFrench, would you be able to dig up a code sample of the programatic node creation that led to this error appearing?

Looking at d8, I can see that the default for 'langcode' for nodes is still ''. While we might argue over what should go there, LANGUAGE_NONE seems like it would be a better option than an empty string (which is never valid as I understand).

thedavidmeister’s picture

Version: 7.x-dev » 8.0.x-dev
thedavidmeister’s picture

Version: 8.0.x-dev » 7.x-dev
Issue summary: View changes
Status: Needs work » Postponed (maintainer needs more info)

I was wrong, I was looking at the 'node_access' table in d8, not 'node'. This just needs more info then in d7.

Status: Postponed (maintainer needs more info) » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.