-
Notifications
You must be signed in to change notification settings - Fork 350
Snippet delete reference #511
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
Conversation
$references = $this->snippetRepository->getReferences($uuid); | ||
|
||
if (count($references) > 0) { | ||
$force = $request->headers->get('SuluForceRemove', false); |
There was a problem hiding this comment.
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
.
0adb34a
to
da0dfe1
Compare
</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> |
There was a problem hiding this comment.
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?
Ready for review. |
5f412d7
to
4f9e3f3
Compare
1ad5483
to
37cc67f
Compare
@danrot @chirimoya ready for final review |
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
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)
37cc67f
to
7a6f6d8
Compare
7a6f6d8
to
bca1269
Compare
bca1269
to
519e38c
Compare
@@ -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()); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pending test passing |
Snippet delete reference
…#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>
This PR will ask the user for (additional) confirmation before removing snippets which are referenced by pages.
TODO