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

Allow workflow-exempt types to have outgoing joins pointing to workflow-based types #303

Open
RyamBaCo opened this issue Feb 19, 2020 · 6 comments
Labels

Comments

@RyamBaCo
Copy link

Hey there,

I'm experiencing issues regarding storing images within an array of a piece. The special use case is that the piece itself is excluded from translations, but I guess that the apostrophe-image inside of the array is not. When switching the locales the attachment url is missing, which should not happen.

My piece looks like:

addFields: [
...
{
      name: "sponsors",
      label: "Sponsors",
      type: "array",
      titleField: "title",
      schema: [
        {
          name: "title",
          type: "string",
          label: "Title"
        },
        {
          name: "url",
          type: "url",
          label: "Url"
        },
        {
          name: "image",
          type: "singleton",
          label: "Bild",
          widgetType: "apostrophe-images",
          required: true
        },
        {
          name: "approved",
          label: "Freigegeben",
          type: "boolean"
        },
        {
          name: "header",
          label: "Im Header anzeigen",
          type: "boolean"
        }
      ]
    }
...
]
@boutell
Copy link
Contributor

boutell commented Feb 21, 2020

Outgoing joins from a piece excluded from workflow may not point to types that are included in workflow. Basically because there is nowhere to store the multiple image ids for the different locales.

This is a frustrating limitation but it is unlikely to change in Apostrophe 2.x due to the fact that when 2.x was first designed, it was not on our radar to include locale information directly in the _id property. In 3.x we intend to fix that.

You could possibly work around it by storing the workflowGuid properties of the images in a property via a beforeSave handler for the piece, and implementing a custom fetch of the images via their workflowGuid when the piece is loaded (a custom cursor filter could do that).

But if you can I would make the piece type in question subject to workflow. If a type depends on something subject to workflow, it should probably be subject to workflow as well.

@boutell boutell added the 3.0 label Feb 21, 2020
@boutell boutell changed the title Images in a List are not exported to other languages Allow workflow-exempt types to have outgoing joins pointing to workflow-based types Feb 21, 2020
@boutell
Copy link
Contributor

boutell commented Feb 21, 2020

Tagged as a 3.0 issue. One of the reasons why we must overhaul _id in 3.0, even if it makes migration a bit of a pain.

@boutell
Copy link
Contributor

boutell commented Feb 21, 2020

In 3.0 _id could look like:

xyzxyzxyz-en-draft
xyzxyzxyz-fr-draft
abcabcabc-en-draft
abcabcabc-fr-draft

@RyamBaCo
Copy link
Author

Thank you for your feedback! I managed to make it work by the workaround of using an attachment type instead of apostrophe-image, but good to know that it's taken in consideration for 3.0.

@boutell
Copy link
Contributor

boutell commented Feb 22, 2020 via email

@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
Labels
Projects
None yet
Development

No branches or pull requests

3 participants