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

fix: areabrick detection #37

Merged
merged 1 commit into from
Nov 13, 2024
Merged

fix: areabrick detection #37

merged 1 commit into from
Nov 13, 2024

Conversation

jdreesen
Copy link
Member

@jdreesen jdreesen commented Nov 13, 2024

The way of checking if a page had certain areabricks was too imprecise. It only checked if the brick identifier was somewhere in the data column of the documents_editables table.

However, if the identifier is searched for without a delimiter, it will erroneously be found as a substring in longer identifiers (for example, “buttons” and “shortcut-buttons”).

We should also limit the search to editables of type areablock, as other editables can have any data that may also contain the identifier (for example, an input editable that contains CSS such as “buttons buttons--blue”).

Therefore, we should only check whether the identifier occurs exactly as a type of an areablock.

The way of checking if a page had certain areabricks was too imprecise. It only checked if the brick identifier was in the `data` column of the `documents_editables` table.

However, if the identifier is searched for without a delimiter, it will erroneously be found as a substring in longer identifiers (for example, “buttons” and “shortcut-buttons”).

Therefore, we should only check whether the identifier occurs exactly as a type of an areablock.
@jdreesen jdreesen marked this pull request as ready for review November 13, 2024 16:24
Copy link
Collaborator

@mike4git mike4git left a comment

Choose a reason for hiding this comment

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

Horny!

@jdreesen jdreesen merged commit 0fce481 into main Nov 13, 2024
4 checks passed
@jdreesen jdreesen deleted the fix-areabrick-detection branch November 13, 2024 16:30
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.

2 participants