-
Notifications
You must be signed in to change notification settings - Fork 351
Feature/search delete from index #581
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
Structure::NODE_TYPE_CONTENT | ||
) | ||
); | ||
$structure->setWebspaceKey($webspaceKey); |
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.
I would really have loved to not have done this.
- Structures should support lazy loading
- I have repeated yet more logic here because the
loadByNode
stuff requires far more work than I can achieve in the scope of this feature.
Viva la revolution.
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.
So you have basically duplicated this code? Why not put it into a separate function, and call it at the other place as well?
@dantleech when will this be merged? I need the delete event for my project. |
@dantleech the tests are failing! could you take a look at this? |
yeah. will do it this afternoon. |
c5aa185
to
ceb44dd
Compare
|
||
Because they are applied otherwise add a permission value of 120 for | ||
`sulu.security.roles`, `sulu.security.groups` and `sulu.security.users` to one | ||
user to change the settings in the UI |
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.
Lets not make upgrade instructions as bullet points.. we will need to give code examples sometimes and it just gets messy.
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.
1cac3a3
to
f49c4eb
Compare
@@ -56,4 +63,17 @@ public function onNodeSave(ContentNodeEvent $event) | |||
$this->searchManager->deindex($structure); | |||
} | |||
} | |||
|
|||
public function onNodePreDelete(ContentNodeDeleteEvent $event) |
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.
Docs
f49c4eb
to
b7d7cf2
Compare
Tests are good. @wachterjohannes @alexander-schranz |
What's the state of this PR? |
was ready. needs a rebase. |
b7d7cf2
to
b618bb9
Compare
Hmm.. actually there are still a few things to tidy up |
|
||
if ($structure->getNodeState() === Structure::STATE_PUBLISHED) { | ||
$this->searchManager->index($structure); | ||
} else { |
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.
else is not required
b618bb9
to
991e5b6
Compare
@@ -24,9 +24,6 @@ class BaseTestCase extends SuluTestCase | |||
public function setUp() | |||
{ | |||
$this->initPhpcr(); | |||
$fs = new Filesystem; | |||
|
|||
$fs->remove(__DIR__ . '/../app/data'); |
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.
why?
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.
Seems fine without this.
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.
Is really all data deleted after every run?
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.
I delete before. It gives you the chance to debug, if you delete after you need to do things like die()
to inspect the state of the database.
But tbh I am not sure why I removed this, I just noticed that it did no harm. Will verify.
991e5b6
to
9bfa3ee
Compare
Ready for review and merge. |
9bfa3ee
to
d9c29b9
Compare
SnippetBundle test failing. |
Can you fix them? |
@@ -2,6 +2,9 @@ CHANGELOG for Sulu | |||
================== | |||
|
|||
* dev-develop | |||
* FEATURE #581 [SearchBundle] Structures deindexed on delete | |||
* FEATURE #581 [Content] NODE_SAVE renamed to NODE_POST_SAVE |
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.
Would write ContentBundle
here, for the sake of consistency
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.
Its not ContentBundle though, its the Component.
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.
Should align it though
1d8d0dc
to
d7b0c6d
Compare
@danrot updated |
6a930a4
to
05d05cd
Compare
- Added NODE_DELETE event - Renamed NODE_SAVE event to NODE_POST_SAVE - SearchBundle deindexes on Structure delete
d7b0c6d
to
926027d
Compare
* Adjust documentation to configure live-generation of URL * Add section about template specific route schema
Search deindexing on node delete and delete event from content mapper
loadShallowStructureForNode
method to ContentMapperto the PHPCR node being deleted)
Tasks:
Depends
Informations: