Skip to content

Conversation

dantleech
Copy link
Contributor

This PR will ask the user for (additional) confirmation before removing snippets which are referenced by pages.

  • In the snippet form
  • In the snippet list
    • Each item is processed individually and the user will be asked to confirm for each snippet which is referenced.

TODO

  • PHP tests

$references = $this->snippetRepository->getReferences($uuid);

if (count($references) > 0) {
$force = $request->headers->get('SuluForceRemove', false);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The snippet delete method on the controller will remove all references to the snippet being deleted ONLY WHEN the SuluForceRemove header is set and is true.

@dantleech dantleech force-pushed the snippet-delete-reference branch 2 times, most recently from 0adb34a to da0dfe1 Compare November 5, 2014 15:00
</trans-unit>
<trans-unit id="13" resname="snippet.delete-no-snippets-selected">
<source>snippet.delete-no-snippets-selected</source>
<target>There are no snippets selected</target>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@katehepberger could you translate these into german?

@dantleech
Copy link
Contributor Author

Ready for review.

@dantleech dantleech force-pushed the snippet-delete-reference branch 2 times, most recently from 5f412d7 to 4f9e3f3 Compare November 5, 2014 15:22
@dantleech dantleech force-pushed the snippet-delete-reference branch 2 times, most recently from 1ad5483 to 37cc67f Compare November 10, 2014 13:53
@dantleech
Copy link
Contributor Author

@danrot @chirimoya ready for final review

}
}


Copy link
Member

Choose a reason for hiding this comment

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

@dantleech remove empty line (only one empty line in a row)

@dantleech dantleech force-pushed the snippet-delete-reference branch from 37cc67f to 7a6f6d8 Compare November 11, 2014 08:29
@dantleech dantleech added feedback and removed review labels Nov 11, 2014
@dantleech dantleech force-pushed the snippet-delete-reference branch from 7a6f6d8 to bca1269 Compare November 11, 2014 14:53
@dantleech dantleech force-pushed the snippet-delete-reference branch from bca1269 to 519e38c Compare November 11, 2014 14:55
@@ -1221,6 +1222,11 @@ public function loadByNode(
$availableLocalization = $localization;
}

// if there was no webspace then determine the webspace from the content node path
if (null === $webspaceKey) {
$webspaceKey = $this->nodeHelper->extractWebspaceFromPath($contentNode->getPath());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@wachterjohannes I have added this as since the loadLocalizedUrls feature, the webspace is a required argument.

This is a problem as when we validate the snippets for references currently for pages which reference the snippet, as the pages could come from any webspace.

The logic here is that if no webspace is given we will infer the page from the path of the node.

Copy link
Member

Choose a reason for hiding this comment

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

@dantleech 👍

@dantleech dantleech added review and removed feedback labels Nov 11, 2014
@dantleech
Copy link
Contributor Author

Pending test passing

wachterjohannes added a commit that referenced this pull request Nov 11, 2014
@wachterjohannes wachterjohannes merged commit bff75b4 into develop Nov 11, 2014
@wachterjohannes wachterjohannes deleted the snippet-delete-reference branch November 11, 2014 16:08
alexander-schranz pushed a commit to alexander-schranz/sulu that referenced this pull request Nov 14, 2024
…#511)

* Add SegmentViewObject to ExcerptViewObject when indexing article

* Filter articles for current segment key in ArticleDataProvider

* Add segments as a twig variable to the output

* Try fixing tests

* Fix segments for Jackrabbit

* Adjust build for prefer-lowest

Co-authored-by: Daniel Rotter <daniel.rotter@gmail.com>
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.

3 participants