plone / plone/plone.restapi

Block transforms don't run for control panels

Open
#1,868 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
109
Forks
107
Avg merge
2d 3h
Merged PRs (30d)
4

Description

There doesn't seem to be an adapter for control panels, so if you try to use blocks in a control panel, the block transforms will never run, meaning we lose out on functionality like create a resolveuid link for links.

Steps to reproduce

  1. Create a control panel with the ability to add/ edit blocks in it (e.g. enable https://github.com/pretagov/volto-slots-editor)
  2. Create a text block with a link in it
  3. Save the control panel
  4. View the data stored from the control panel

Expected result

The URL of the link has been changed to resolveuid

Actual result

The URL stays as the absolute URL created from the POST request.

Investigation

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/plone/restapi/deserializer/controlpanels/init.py and src/plone/restapi/blocks.py, then trace how FakeDXContext is passed to iter_block_transform_handlers and how subscriptions are resolved. Compare this with a real object context as described in the investigation. Done means block transforms run for control-panel data and links are stored using resolveuid URLs.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.