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 EZP-23282: Solr returns wrong results after object language deletion #170
Conversation
foreach ( $languages as $language ) | ||
{ | ||
$languageCode = $language->attribute( 'locale' ); | ||
if ( $language instanceof eZContentLanguage ) |
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.
said in phpdoc that languages will be an array of string, in which case can be a eZContentLanguage object?
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.
see line 889
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.
wops. sorry then.
In general. Probably i'm missing something but looks weird to me that for a delete operation we're adding more logic to the I mean, isn't possible to modify your pov @gggeek ? Edit: Anyway, if i'm not wrong, if when deleting translation solr index is not updated, wouldn't you need to wait for a publish operation in order to make addObject works? |
Yes it looks weird to delete things in a method called The situation is that an object can refer to several solr doc if you are using more than one language (1 solr doc per translation). So if you update an object whose translation has been removed, you need to delete a solr doc. As @dpobel was telling me yesterday, it is important to keep in mind that: ezobject != solr doc |
so, when a translation is deleted a "update object" is performed ?
my point is we shouldn't wait for that update. it should be possible to trigger the update thing when the translation is removed... Edit. Something similar to what is done when deleting an object. https://github.com/ezsystems/ezpublish-legacy/blob/master/kernel/classes/ezcontentobject.php#L1950 Wondering if we could just adding that logic to the deleteVersion operation and use the changes you add in removeObjectById... |
+1 |
+0,5 ( review ping @paulborgermans ) |
I would also prefer to have the remove translation operation to call the modified removeObjectByID function in ezsolr. |
@paulborgermans I think we all would. But preferences aside, do you see any risk with this approach ? I don't like this, but if it works (tm)... |
@bdunogier no, there is no risk in this approach other than the few extra cpu cycles, so +1 |
Fix EZP-23282: Solr returns wrong results after object language deletion
I noticed a mistake while backporting, contentObject was passed in parameters instead of contentObjectId. Fixed it in: 722313b |
Link: https://jira.ez.no/browse/EZP-23282
Description
When deleting the translation of an object, the solr index is not updated.
Tests
Manual tests