The author is set to "Anonymous (not verified)" when creating or editing a node via the Inline Entity Form.

Expected behaviour would be to set the author information to the one that is logged in, or to inherit the author of the parent node.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

copilot created an issue. See original summary.

slashrsm’s picture

Issue tags: +D8Media, +Media Initiative
tedbow’s picture

I have tested this with the Simple widget.

It seems that now the behavior is that the logged in user is the author regardless of the whether the author of the parent node is set to a different user or not.

So if the user has permission and sets the parent node to a different user the current user is still the author of the child node.

I assume the correct behavior would be that whoever is set to the author of the parent node on the nodes in the IEF widgets should use that author.

tedbow’s picture

Title: Nodes have no author » Nodes author is always logged in user
tedbow’s picture

This issue is really blocked by #2667710: Rewrite the base inline form handling.

Because right now if you give a user the permission to set the author of a node they will get a "Authored by" widget for the parent AND child nodes in IEF widgets.

So presumably the child widget if shown(which it should not be) should probably win.

tedbow’s picture

Here is test to check owner of parent and child nodes in simple widget. It currently fails.

This test should probably eventually be added to test in #2667710: Rewrite the base inline form handling

So we could have single test for adding IEF nodes as admin.

Status: Needs review » Needs work

The last submitted patch, 6: ief-nodes_author_is_always-2593269-6_TEST_ONLY.patch, failed testing.

tedbow’s picture

Title: Nodes author is always logged in user » Nodes have no author
Status: Needs work » Needs review
FileSize
0 bytes

Changing title back. I was wrong I think about expected behavior.

Expected behaviour would be to set the author information to the one that is logged in, or to inherit the author of the parent node.

I checked Drupal 7 version "author information to the one that is logged in" is what happens and there are no open issues regarding this so I am assuming this is correct.

So he 8.x-1.x-dev version already works.

I am updating the patch with just the test changed to confirm it works.

Status: Needs review » Needs work

The last submitted patch, 8: ief-nodes_author_is_always-2593269-8.patch, failed testing.

tedbow’s picture

Status: Needs work » Needs review
FileSize
1.61 KB

my bad uploaded a empty patch. re uploaded

tedbow’s picture

Ok. This must have been fixed in other commits.

So the test just confirms this.

bojanz’s picture

Not sure the test in #10 is useful, considering that the "uid defaults to the current user" behavior comes from TypedData / the entity field itself? We're not testing our own logic.

bojanz’s picture

Status: Needs review » Closed (works as designed)

We decided not to chase this based on #12.