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 deaccession deletion issue, refs #12460 #871

Merged
merged 1 commit into from Apr 10, 2019

Conversation

mcantelon
Copy link
Member

Fixed issue where deleting a deaccession would remove the
accession/accural related to it from the search index.

@@ -45,8 +45,6 @@ public function save($connection = null)

public function delete($connection = null)
{
QubitSearch::getInstance()->delete($this->accession);
Copy link
Member

Choose a reason for hiding this comment

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

If we are updating the index when we save/add an accession, then will we need to also '->update' on a delete? Or is the '->update' in save() not necessary either?

Copy link
Member Author

Choose a reason for hiding this comment

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

I did some testing and looked at the code and it seems like the parent accession's document exists independently of whether or not there's a deaccession so I've removed both of the ElasticSearch alterations.

Copy link
Member Author

Choose a reason for hiding this comment

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

(I've gotten rid of the update in the save because of this.)

Copy link
Member Author

@mcantelon mcantelon left a comment

Choose a reason for hiding this comment

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

I've updated the PR.

@@ -45,8 +45,6 @@ public function save($connection = null)

public function delete($connection = null)
{
QubitSearch::getInstance()->delete($this->accession);
Copy link
Member Author

Choose a reason for hiding this comment

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

I did some testing and looked at the code and it seems like the parent accession's document exists independently of whether or not there's a deaccession so I've removed both of the ElasticSearch alterations.

@@ -45,8 +45,6 @@ public function save($connection = null)

public function delete($connection = null)
{
QubitSearch::getInstance()->delete($this->accession);
Copy link
Member Author

Choose a reason for hiding this comment

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

(I've gotten rid of the update in the save because of this.)

Copy link
Member

@sbreker sbreker left a comment

Choose a reason for hiding this comment

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

Looks great @mcantelon! Thanks for looking at that ->update() method!

@mcantelon
Copy link
Member Author

Thanks @sbreker!

@qubot qubot force-pushed the dev/issue-12460-deaccession-deletion-fix branch from 16444f3 to 3beb188 Compare April 10, 2019 17:50
Fixed issue where deleting a deaccession would remove the
accession/accural related to it from the search index.
@qubot qubot force-pushed the dev/issue-12460-deaccession-deletion-fix branch from 3beb188 to 830814b Compare April 10, 2019 17:51
@qubot qubot merged commit 830814b into qa/2.5.x Apr 10, 2019
@qubot qubot deleted the dev/issue-12460-deaccession-deletion-fix branch April 10, 2019 17:51
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.

None yet

3 participants