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

join between types included from workflow and another excluded from it #253

Open
GiuseppeCM opened this issue Jul 18, 2019 · 8 comments
Open

Comments

@GiuseppeCM
Copy link

I have one piece type excluded from the workflow, and in this type I have a join with 'apostrophe-images'. Apostrophe-images is included in the workflow. If I edit the first type in mode live, and I populate this join, is ok, but if I switch in mode draft, I can not see the images in the manager modal. I have the apostrophe-pieces-page too, and in the show page, in mode live I see the image, but in draft no... sounds like a problem in populating joins between one type excluded from the workflow and another included in the workflow.

@boutell
Copy link
Contributor

boutell commented Jul 22, 2019

This is a legitimate issue. Unfortunately it probably isn't possible to resolve it when the join is from the excluded type to the included type, at least without a major change to the engineering of how joins are implemented in workflow. That's because joins are by _id and the _id is different across locales, and for a type that is excluded there is simply nowhere to store the different ids per locale, etc.

This is unlikely to change at least until the 3.x version of workflow.

However is it possible, in your case, to edit this via a join from the other end (the type that has workflow), and use a joinByOneReverse or joinByArrayReverse to access that content from the end that does not have workflow? That ought to work correctly.

@GiuseppeCM
Copy link
Author

Hi @boutell
I can't create a joinByArrayReverse because it's too big to do right now, since the images are around 3000.
At this moment I solve this issue inserting in a join with apostrophe-image this filter: workflowLocale: 'forDetailPage' and I have extended apostrophe-workflow/lib/modules/apostrophe-workflow-docs/lib/cursor.js whit this condition if (setting === 'forDetailPage') { return; }(with this condition, does not apply self.and({ workflowLocale: setting });).
I know it's not an optimal way to do this but right now it works.
If it were to give me any other problems, I think I would exclude the apostrophe-image from workflow.

@boutell boutell added the 3.0 label Jul 29, 2019
@boutell
Copy link
Contributor

boutell commented Jul 29, 2019

Most likely this restriction will be lifted in 3.0, probably by building a workflowGuid directly into the _id.

@GiuseppeCM
Copy link
Author

Hi @boutell

I tried to follow your advice to create a join and use the reverse, but even in this case it doesn't work and the behavior is the same.

@boutell
Copy link
Contributor

boutell commented Sep 6, 2019

OK, I would need to see a test project replicating the issue.

@GiuseppeCM
Copy link
Author

I created this repository: https://github.com/GiuseppeCM/joinWorkflow and I noticed that this issue occurs only in the case where the joinByArray has an array of more than two pieces as the value of the withType field, and as I told you on git, the same issue the same behavior has it with the joinByArrayReverse.

@boutell
Copy link
Contributor

boutell commented Sep 9, 2019

OK, can you open a new issue on this ("reverse join does not work with polymorphic join to two or more types...") to avoid confusion and we'll go from there. I want to keep this ticket open for the 3.x feature to allow what you originally wanted. Thanks!

@stale
Copy link

stale bot commented Jun 19, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jun 19, 2020
@abea abea removed the stale label Jun 22, 2020
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