Closed (fixed)
Project:
Apache Solr Search
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
28 Aug 2015 at 12:36 UTC
Updated:
25 Dec 2020 at 18:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
luizsgpetri commentedComment #3
luizsgpetri commentedComment #5
luizsgpetri commentedComment #6
luizsgpetri commentedPatch
Comment #7
luizsgpetri commentedComment #8
luizsgpetri commentedComment #9
DeFr commentedAs written, this is going to break backward compatibility for all the existing reindex callback functions, which expect the second parameter to be an optional bundle parameter and not the entity type.
In apachesolr alone, to get this to work correctly, you'd need to change
apachesolr_index_node_solr_reindexto take the newly added second parameter. But this also means that all of contrib would need to change, which seems quite wasteful.That patch would be a lot less disruptive if the new argument is added at the end of the function.
Comment #10
luizsgpetri commentedComment #11
caminadaf commentedI've done the suggested changes and reapplied the patch against the latest 7.x-1.x branch and tested it with nodes and custom entities.
Comment #12
caminadaf commentedComment #13
luizsgpetri commentedComment #14
douggreen commentedI think that this is still going to cause problems with backwards compatibility. If someone already has a custom reindex function without the additional argument passed, and this were to call that function, PHP will complain about the additional argument. Please contact one of the module maintainers and work out the architecture for this. One suggestion I have is to add a new argument called 'reindex callback version' and check that, and only pass the additional argument if this is set to the new version.
As this is currently written, the additional argument needs to be added to the apachesolr_index_node_solr_reindex doxygen.
Comment #15
caminadaf commented@douggreen,
I just realized that PHP doesn't actually sends errors or notices when a function receives additional parameter. Instead, it allows it so that we can define function with a variable number of arguments.
So if a custom module is expecting only two parameters and we send 3, it won't make a difference, since we didn't change the order of the parameters.
Comment #16
caminadaf commentedComment #17
douggreen commentedinteresting, agree. I tested the argument error/warning locally. RTBC from me too.
Comment #19
japerry