Overview

When we have an entity saved in the DB with the result 'Experience Builder,' and then create another entity named 'Untitled Page' and change its title to 'Experience Builder' without publishing it, and perform a search for 'Experience Builder,' we get both results, which is correct. However, when we search for 'Untitled Page,' we only get one result, which should not be the case.

Proposed resolution

change the logic in ApiContentControllers.php in list() method to cover this scenario.

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

deepakkm created an issue. See original summary.

wim leers’s picture

Title: Entity saved with autosaved data is not respected » `ApiContentControllers::list()`: search should exclude entity query matches for entities with auto-save data
Component: Page builder » Internal HTTP API
Assigned: Unassigned » deepakkm
Status: Active » Postponed (maintainer needs more info)

The title is very ambiguous. Tried to clarify it. Can you confirm it is correct?

However, when we search for 'Untitled Page,' we only get one result, which should not be the case.

Your wording implies there should be >1 result, but AFAICT there should be 0?

wim leers’s picture

Plus, as @larowlan argued: why is this even a bug? Isn't this a feature?

deepakkm’s picture

Yes the result count should be 0 in this scenario thats what i meant by saying "However, when we search for 'Untitled Page,' we only get one result, which should not be the case."

deepakkm’s picture

Assigned: deepakkm » Unassigned
Category: Bug report » Feature request

Agree to it that this should be under a feature but not as bug. As it was never worked upon earlier.

deepakkm’s picture

wim leers’s picture

Title: `ApiContentControllers::list()`: search should exclude entity query matches for entities with auto-save data » Follow-up for #3518292: `ApiContentControllers::list()`: search should exclude entity query matches for entities with auto-save data
Assigned: Unassigned » deepakkm
Issue tags: +Needs tests
Related issues: +#3518292: Allow searching for content in the navigator, via `/xb/api/v0/content/{entity_type}`

#5: #3518292: Allow searching for content in the navigator, via `/xb/api/v0/content/{entity_type}` is in, can you add failing test coverage to illustrate what you're saying? Because I still don't understand 🫣

deepakkm’s picture

I think this can be closed now, as the problem seems to be resolved with the fixes done for Autosave earlier in previous MRs.
And the scenario mentioned in the description of the ticket works well now.

wim leers’s picture

Assigned: deepakkm » Unassigned
Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Great, thanks!