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

Add preview_image and preview_image_link to the list of smart fields for resolveuid and link integrity #1735

Merged
merged 2 commits into from
Nov 23, 2023

Conversation

sneridagh
Copy link
Member

No description provided.

Copy link

netlify bot commented Nov 23, 2023

Deploy Preview for plone-restapi canceled.

Name Link
🔨 Latest commit 10fb21e
🔍 Latest deploy log https://app.netlify.com/sites/plone-restapi/deploys/655f699f10f13800086f9c1d

@sneridagh sneridagh changed the title Add preview_image and preview_image_link to the list of smart fields for resolveuid and link_integrity Add preview_image and preview_image_link to the list of smart fields for resolveuid and link_integrity Nov 23, 2023
@mister-roboto
Copy link

@sneridagh thanks for creating this Pull Request and helping to improve Plone!

TL;DR: Finish pushing changes, pass all other checks, then paste a comment:

@jenkins-plone-org please run jobs

To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically.

Happy hacking!

@sneridagh sneridagh changed the title Add preview_image and preview_image_link to the list of smart fields for resolveuid and link_integrity Add preview_image and preview_image_link to the list of smart fields for resolveuid and link integrity Nov 23, 2023
Copy link
Member

@ericof ericof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sneridagh
Copy link
Member Author

@jenkins-plone-org please run jobs

@tisto tisto enabled auto-merge (squash) November 23, 2023 15:38
@tisto tisto merged commit 497055b into main Nov 23, 2023
18 checks passed
@tisto tisto deleted the addpreviewimagelinkintegrity branch November 23, 2023 15:43
Copy link
Member

@davisagli davisagli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sneridagh @tisto Please don't release this, it doesn't look right to me.

@@ -111,7 +110,7 @@ def __call__(self, block):
Returns a list of internal links
"""
links = []
for field in ["url", "href"]:
for field in ["url", "href", "preview_image", "preview_image_link"]:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't make any sense, there will not be a preview_image or preview_image_link inside a slate block value.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I was reading it wrong, this is the generic blocks retriever. It makes sense for preview_image, which is used in the teaser block. It doesn't make sense for preview_image_link, which is a relation field not in blocks. I don't think we need to do anything special to make linkintegrity work for a relation field.

src/plone/restapi/deserializer/blocks.py Show resolved Hide resolved
src/plone/restapi/serializer/blocks.py Show resolved Hide resolved
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

Successfully merging this pull request may close these issues.

5 participants