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

Workflow email link does not link to the correct draft but only to the live version of the entry #204

Open
azad6026 opened this issue Feb 15, 2024 · 15 comments

Comments

@azad6026
Copy link

Describe the bug

Workflow email link does not link to the correct draft but only to the live version of the entry.

Steps to reproduce

  1. Editor edits a page and submits thier draft for approval as usual
  2. Publisher receives an email with the link to approve the entry submitted
  3. The email link is linking to the live version of that entry and not the correct draft , therefore , no button to approve anything and the publisher has to manually go to workflow and approve the entry. The link in the email does not have any draftId in it.

Craft CMS version

4.7.0

Plugin version

2.0.8

Multi-site?

No

Additional context

This happens both in local and production.

@engram-design
Copy link
Member

Quick clarification here - is the editor creating a brand new entry, or a draft on an already existing entry? The two processes can work slightly differently, so it's worth noting the difference one way or the other.

The submission.ownerCpUrl that's used in emails should resolve to the last review's owner cpEditUrl. In this case, the owner should be the draft entry you've submitted.

@azad6026
Copy link
Author

azad6026 commented Feb 18, 2024

Hello and thanks for coming back to this.If the editor is creating a brand new entry, the email link is correct. But if the editor is creating a draft on an existing entry,this process does not create the correct email link. This is the issue we hope to get a fix for as it is a problem for our clients. Thanks.

@azad6026
Copy link
Author

Hi there. Is there any response or thoughts available on this matter. This is important for us. Appreciate it. Cheers

@azad6026
Copy link
Author

Hi there,this issue is important for our clients and I would appreciate if it is being looked into and responded. Thanks

@engram-design
Copy link
Member

Haven't forgotten about this, just struggling to reproduce this one on our end. Are you able to send through the email template for the submission notification? These can be found in Utilities > System Messages.

@engram-design
Copy link
Member

Actually, just after sending this I was able to replicate this one. Should be fixed for the next release. To get this early, run composer require verbb/workflow:"dev-craft-4 as 2.0.8".

@azad6026
Copy link
Author

azad6026 commented Mar 3, 2024

Thank you so very much. Tested it and the issue is now resolved. Cheers.

@engram-design
Copy link
Member

Updated in 2.0.9

@43north
Copy link

43north commented Feb 6, 2025

Hi, we are seeing this issue happen again for us, after updating to Craft 5.6.5.1 and Workflow 3.0.6.

In the email notification from the editor to the publisher, the {{ submission.ownerCpUrl }} variable is set to the current live version of the entry rather than the actual draft, the "?draftId=xxxxxx" is omitted.

@engram-design
Copy link
Member

I'm not able to replicate this sorry. Can you locate the review in the workflow_reviews database table, and ensure that the draftId value is actually set?

@43north
Copy link

43north commented Feb 8, 2025

In this particular case, the draftId was not set in the table. But after further testing it seems to be fine for yet-to-be published entries. It seems to occur when the editor submits an additional draft to an already published listing that they want to update. The draftId for the new draft was set in the table but not displayed in the email notification, very strange.

@engram-design
Copy link
Member

That was my next question, whether this was a brand-new entry, or a new draft on an entry. Technically in either case they should both be drafts, but just wanted to confirm regardless.

So just to confirm, you're making a submission on an already published entry (so a new draft is being made), and the draftId value is there - it's just in the email notification it's not linking to that draft?

@43north
Copy link

43north commented Feb 8, 2025

Yes, that's it exactly

@engram-design
Copy link
Member

engram-design commented Feb 9, 2025

I think I've narrowed things down. Should be fixed for the next release. To get this early, run composer require verbb/workflow:"dev-craft-5 as 3.0.6".

@engram-design engram-design reopened this Feb 9, 2025
@43north
Copy link

43north commented Feb 10, 2025

That seems to have done the trick, thanks!

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

No branches or pull requests

3 participants