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

do not let a page become a child of itself #4726

Merged
merged 2 commits into from
Sep 20, 2024
Merged

do not let a page become a child of itself #4726

merged 2 commits into from
Sep 20, 2024

Conversation

boutell
Copy link
Member

@boutell boutell commented Sep 12, 2024

Summary

Summarize the changes briefly, including which issue/ticket this resolves. If it closes an existing Github issue, include "Closes #[issue number]"

What are the specific steps to test this change?

See unit tests. I don't know how an end user can convince the UI to attempt it, but the important thing is that the backend API refuse to do it, which is what I've implemented here. (My new test did fail until I made the fix.)

What kind of change does this PR introduce?

(Check at least one)

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Build-related changes
  • Other

Make sure the PR fulfills these requirements:

  • It includes a) the existing issue ID being resolved, b) a convincing reason for adding this feature, or c) a clear description of the bug it resolves
  • The changelog is updated
  • Related documentation has been updated
  • Related tests have been updated

If adding a new feature without an already open issue, it's best to open a feature request issue first and wait for approval before working on it.

Other information:

@@ -421,6 +421,16 @@ describe('Pages', function() {
assert.strictEqual(page.rank, 1);
});

it('is not able to move a page under itself', async function() {
await assert.rejects(
Copy link
Member Author

Choose a reason for hiding this comment

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

Love that assert.rejects need to use it more, it's very awkward to write this kind of test correctly otherwise, often done wrong

BoDonkey
BoDonkey previously approved these changes Sep 18, 2024
@boutell boutell merged commit 0e978d8 into main Sep 20, 2024
8 checks passed
haroun added a commit that referenced this pull request Sep 23, 2024
* main:
  hotfix 4.7.1 (#4733)
  PRO-6591: parked fields overrides (#4732)
  do not let a page become a child of itself (#4726)
  adds focus states for file input and media lib uploader (#4729)
  add <use> tag to DOMPurify allow list when sanitizing uploaded SVGS (#4727)
haroun added a commit to haroun/apostrophe that referenced this pull request Sep 26, 2024
* upstream/main:
  fix oversights in add missing schema fields (apostrophecms#4736)
  upgrate stylelint-config-apostrophe to 4.2.0 (apostrophecms#4735)
  PRO-6472: at startup, automatically supply a value for any new schema property that has a def or fallback def (apostrophecms#4721)
  fix sass warning (apostrophecms#4730)
  fix piecesFilters with dynamic choices (apostrophecms#4731)
  hotfix 4.7.1 (apostrophecms#4733)
  PRO-6591: parked fields overrides (apostrophecms#4732)
  do not let a page become a child of itself (apostrophecms#4726)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants