Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.x]: A provisional draft created via GraphQL API is not visible in control panel UI #13401

Closed
ivanBereznev opened this issue Jul 7, 2023 · 2 comments
Assignees

Comments

@ivanBereznev
Copy link

ivanBereznev commented Jul 7, 2023

What happened?

Description

A provisional draft created via GraphQL API is not visible in control panel UI when original entry has no author assigned.

Steps to reproduce

  1. Create an entry without assigning an author. On of the ways to achieve that is a Feed Me import.
  2. Create a provisional draft for this entry using the createDraft GraphQL mutation.
  3. Optionally modify the draft via GraphQL API, e.g. change title.
  4. Open edit form for that entry in Control Panel

Expected behavior

Control Panel should show that there is a provisional draft, i.e. there should be this "unsaved changes" bar:
provisional_draft_bar

If that provisional draft contains some changes, they should be reflected in the edit form.

Actual behavior

Control panel does not show that bar. Changes from the draft are not present in the form. Change made to the edit form causes creation of one more provisional draft.

Craft CMS version

4.4.11

PHP version

8.0.22

Operating system and version

Debian GNU/Linux 11

Database type and version

PostgreSQL 13.6

Image driver and version

Imagick 3.7.0 (ImageMagick 7.1.0-35)

Installed plugins and versions

@i-just
Copy link
Contributor

i-just commented Jul 10, 2023

Hi, thanks for reporting!

It’s happening because, for drafts created via GraphQL, the creator is derived from the entry’s author. When the entry doesn’t have one, the draft creator will also be empty. A provisional draft will only show in the control panel for its creator, so if the creator is null, the provisional draft exists in the database but won’t be pulled in and shown to anyone.

I’ve added the creatorId argument to the createDraft mutation to mitigate this.

@brandonkelly
Copy link
Member

Craft 4.4.16 is out with the new creatorId argument.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants