Overview

Discovered when testing #3537146: Link Publish errors to the page + component instance that's causing the error. The source the pointer value is sometimes inconsistent. See screenshot below. This the source.pointer starts with model for the first and starts with components for the second.

screenshot of error

Steps to reproduce:

1. Create the code component below. Text and link required prop.
2. Click add to components.
3. Add two instances of the component on the page (xb_page).
4. Edit the url prop to be empty on both of the instances that are on the page (Wait for auto-save).
5. Publish the xb_page that the 2 components are on.
6. View publish error response.

Code component used:

uuid: 6c21e124-4d78-408b-8896-1a26a28bcbdc
langcode: en
status: true
dependencies: {  }
machineName: c1
name: c1
required:
  - text
  - url
props:
  text:
    title: text
    type: string
    examples:
      - hello
  url:
    title: url
    type: string
    examples:
      - 'https://www.hello.com'
    format: uri
slots: {  }
js:
  original: |
    // See https://project.pages.drupalcode.org/experience_builder/ for documentation on how to build a code component

    const Component = ({
      text,
      url,
    }) => {
      return (
        <div className="text-3xl">
          {text}
        <br></br>
          {url}
        </div>
      );
    };

    export default Component;
  compiled: |
    // See https://project.pages.drupalcode.org/experience_builder/ for documentation on how to build a code component
    import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
    const Component = ({ text, url })=>{
        return /*#__PURE__*/ _jsxs("div", {
            className: "text-3xl",
            children: [
                text,
                /*#__PURE__*/ _jsx("br", {}),
                url
            ]
        });
    };
    export default Component;
css:
  original: ''
  compiled: ''

Proposed resolution

Should be consistent

User interface changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

hooroomoo created an issue. See original summary.

hooroomoo’s picture

Issue summary: View changes
wim leers’s picture

Title: source.pointer value from publish error response is inconsistent sometimes » `source.pointer` value from publish error response is inconsistent sometimes
Component: … to be triaged » Internal HTTP API
Issue tags: +validation

Thanks for reporting this! This means either a bug in \Drupal\experience_builder\Validation\ConstraintPropertyPathTranslatorTrait::translateConstraintPropertyPathsAndRoot(), \Drupal\experience_builder\Plugin\Validation\Constraint\ComponentTreeStructureConstraintValidator::translatePropertyPath(), or one of its callers.

larowlan’s picture

Assigned: Unassigned » larowlan

🏗️

larowlan’s picture

Assigned: larowlan » Unassigned
Status: Active » Needs review

Fix and test up

wim leers’s picture

Status: Needs review » Reviewed & tested by the community

Thanks! Test-only CI job failed 👍 Just clarified one comment :)

  • wim leers committed db89d59a on 1.x authored by larowlan
    Issue #3538110 by wim leers, larowlan, hooroomoo: `source.pointer` value...
wim leers’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.