Seems like mxr576 accidentally set this to RTBC in #15, so setting back to NW. Iām leaning towards āClosed (wonāt fix)ā, though ā the ddev lead developer saying itās a bad idea sounds hard to beat.
If you can come up with a single file that youād say is almost as useful as your current proposal (as mkalkbrenner suggests in #14), and if itās easy enough to maintain I might still consider it, but would still need stronger support than now.
ensures all contributors run the same clean, isolated, and predictable environment.
I donāt plan on using ddev for my local contrib dev environment, so thatās actually more a con than a pro in my books.
Does anyone else have any input on this?
Thanks for posting the patch!
Can someone confirm that the patch resolveds the problem for them?
@ravi shankar karnati: Can you confirm the patch works for you, then?
Currently not, no. At the moment I have trouble enough finding the time to do the bare minimum contrib work to keep my modules maintained, so I donāt want to start such a larger task at this point, without any pressure.
Though I would love having a 2.0.0 version, I can neither spare the time right now nor deal with the inevitable maintenance/support headaches that will surely follow.
Merged into the 1.x branch, will test there.
Merged into the 1.x, will test there.
Thanks for reporting this problem!
I wasnāt aware of the language
parameter that seems to exist for both /emsuggest
and /emselect
and apparently also causes issues by its absence in the latter ā for instance, synonyms were not working as expected for the non-default languages.
All of this should be fixed in this merge request. (It depends on this MR from ⨠Improvements for the āRelevance modelā option in SearchStax Solr views Active since both require calculating a ācurrent languageā for a search query.)
drunken monkey ā made their first commit to this issueās fork.
Implemented in this merge request.
Confirmed to be working.
Confirmed to be working.
drunken monkey ā created an issue.
This is now merged, but still open for comments in case anything doesnāt work as expected.
I didnāt see this in time and created a duplicate issue for this in the SearchStax module (
š
Spellcheck not working
Active
), sorry. The problem is that (if the user has selected that option) we want SearchStax to handle the spellcheck functionality and therefore remove the Spellcheck component from the Solarium query. However, Solarium apparently checks for that when parsing the response so we then donāt get the Spellcheck component in the response object even though there is a spellcheck
key in the response JSON.
I expect that that was a deliberate decision when writing the Solarium library so this is likely not gonna change. Therefore I thought the simplest solution would be to ātrickā Solarium by re-adding the Spellcheck component after the search request was sent but before the response is actually parsed (\Solarium\Core\Query\Result\QueryType::parseResponse()
).
But if we could have a solution in Solarium or the Solr module that would of course be even better, itās a bit hack-y this way.
Should be fixed with this MR.
drunken monkey ā created an issue.
drunken monkey ā made their first commit to this issueās fork.
@jrb: That wouldnāt be possible with the current code, youāre right.
What would make a separate processor a bit awkward is that this code is actually not in the processor plugin but in parts of the framework code. (Which is not ideal, architecturally, but couldnāt be helped.) So weād be adding a completely empty processor plugin class for this. Still, the user doesnāt care about that, of course, and if there are some people who want only one half of this functionality it makes sense to split it.
Alternatively, we could add config to the āEntity statusā processor to allow users to enable/disable the functionality for the indexed items and for referenced entities separately. Maybe that would make more sense?
One thing we have to take into account in this decision is the experience for sites that are already using the āEntity statusā processor and are unaware of this issue. (And which even have references to unpublished entities.) Should the behavior change for them without notice or do we require them to change a setting somewhere to get this new behavior?
Or, asked differently: Will most affected users consider the current behavior a bug (that they might be unaware of) or desired?
In any case, I guess we should also add a change record to make site owners aware of this change. And Iāll try to remember to mention it in the release notes.
Merged. Should be fixed in the dev version of the module.
drunken monkey ā created an issue.
Merged to the dev branch, might further refine the feature in follow-ups.
Do you mean it appears when importing an index config where you have server: null
and status: true
?
That is an invalid config, so I donāt think we can be held responsible for any errors that occur consequently.
I think we need test coverage for this to proceed.
Right now, I cannot even see how the original problem would occur without config overrides being present. And if they are present, see above: I donāt think we can be made responsible for people forcing invalid config. Then the only real bug here would be that server: ''
makes no sense.
@mxr576: Thanks for bumping this, seems this slipped through the cracks.
However, on reviewing the MR, do we maybe also need to make a modification to SearchApiTimeTagCache
, which was added in the meantime (see
āØ
Add a third Views cache plugin (tag- and time-based)
Needs work
)?
Other than that, I agree, this is ready to be merged.
Thanks a lot for your work on this, much appreciated!
According to this change record ā the Views plugin types were converted to attribute discovery in Drupal 10.3 so I think we need to depend on that in order to drop the BC annotations right away. However, since 10.2 is already unsupported (unless Iām mistaken it even seems like support for 10.3 was just dropped) I think this should be fine.
Surprisingly, the failing test is related: Switching our Views row plugin(s) back to use the @ViewsRow
annotation does fix the test. The functionality tested is implemented in search_api_search_api_index_insert()
but it seems the call to \Drupal::getContainer()->get('plugin.manager.views.row')->clearCachedDefinitions()
does not work when using an attribute instead of an annotation. Not even sprinkling further such calls throughout the code (e.g., in the test method itself right after creating the new index, or in \Drupal\views_ui\Form\Ajax\Display::__construct()
) fixes the test.
On the other hand, the functionality seems to work fine when trying it out manually (adding a new index and checking whether you can set its row style to āRendered entityā without a manual cache clear) so this seems to be a tests-only problem, which likely would have to be fixed in Drupal Core.
However, I now spent several hours of precious contrib time on this and donāt have time to file a Core issue with the necessary information and (ideally) failing test case. Leaving this for either anyone else to take care of or for me to later pick up when I have the time. For now, I guess we have to leave the workaround in place to make pipelines pass.
The final remaining deprecation warnings regard our own plugin types and their lack of attributes. I added attribute discovery for backend plugins but this also was a bit of work so I had to leave it at that. If noone else currently has the time we can ignore those warnings for now and add a follow-up issue.
When running composer install
from inside the Git checkout of this module youād also need to add the repositories
entry for the Drupal Packagist repo, but yes, I then also had to add the branch alias for it to work.
While Iām again not familiar enough with Ddev to confidently say whether this change works as intended or is even needed, it seems harmless enough and does fix at least something, so it should hopefully at least not cause any problems. I therefore merged it, hopefully it will help a few people.
Thanks again!
OK, thanks for the detailed explanation!
I will still leave this open to be reviewed by others since I know too little about it to confidently say whether this makes sense or not. But I see no problems so far.
Should be fixed in this merge request, Iāll merge it if the test bot is happy.
drunken monkey ā created an issue.
Marking this as fixed for now, might re-open or create follow-up issues in case any problems emerge.
Implemented in this merge request.
As far as I can tell, only the /admin/info/system
endpoint is blocked for SearchStax apps that use Basic Auth, and all others need to use our custom connector plugin anyways, which already takes care of bypassing all requests to blocked endpoints.
Merged.
Thanks again!
Looks good, and seems small enough of a change to be acceptable even if it probably wonāt be useful to more than a few people/modules.
I made some minir changes to the MR, please review. Also the newly adapted test is failing, my guess would be that the index instance use in the indexing batch is not the same as in the test method.
If you can think of another quick way to test the new method, that would be great, but otherwise Iād say itās also no big deal if there is no test coverage, as long as youāre confident it works as desired (as the main user of the new method) and think itās unlikely it will ever break due to some changes in Core or our batch indexing code.
drunken monkey ā made their first commit to this issueās fork.
Merging this so it can be tested in the dev snapshot.
I think this looks good now, thanks!
Merged to the dev branch, will test from there.
This has an MR now.
drunken monkey ā created an issue.
drunken monkey ā created an issue.
drunken monkey ā created an issue.
drunken monkey ā created an issue.
Thanks a lot for suggesting this improvement!
I must admit Iām not too familiar with DDEV so am a bit overwhelmed by this MR.
Could you please tell me some examples of other modules that have already done this? Do you have links to some issues that discuss this change?
Adding a whole new folder with 19 files seems like a pretty big change. What exactly is the advantage of doing this, seems like most of this is auto-generated? (In fact, could you please tell me which parts are not auto-generated? Is it just the first few lines of .ddev/config.yaml
? If so, wouldnāt DDEV be able to generate the rest anyways, without us including it in the repository?)
Also, what exactly is the use case for which this is needed? Is this for including Search API in any website project, or just for testing Search API on its own in a test environment?
Finally, why did you choose MariaDB and specifcally version 10.11? Isnāt hard-coding that in our module repo a problem?
Thanks for reporting this issue and already providing an MR!
Unfortunately hard to test whether this actually works ⦠How confident are you in your solution? Any examples of other projects where this worked/helped?
Looks perfect, thanks for spotting this!
Merged.
OK, this seems to work and be backwards-compatible, just like
the change record ā
promised.
Now we just need to go through around 40 other plugins and make this change.
Anyone interested in a simple, if slightly annoying, issue credit? Otherwise Iāll try to get to it when I have more time (and might just silence those deprecation warnings in the meantime).
Regarding the Postgres failure: unfortunately that seems to be persistent. Does anyone have any idea what could be going wrong there?
In the schedule config, Iām setting _TARGET_DB_VERSION
to $CORE_PGSQL_MIN
ā is that maybe wrong?
Hi, and thanks for reporting this issue!
However, I donāt think Iāve heard something like this before and can assure you that this works in general, of course, we have extensive test coverage to prove that. Therefore, Iām not sure what I can do here to help you, I donāt really have suggestions on what to try.
Or, if youāre trying this on your existing site, maybe try with a bare installation of Drupal? If that works, try to change one thing at a time and see when it breaks. But a lengthy process for sure, sorry.
Maybe someone else has run into this before and can jump in here.
The Postgres fail looks like itās just a CI problem (database not running), nothing to do with us. Iāll run the pipeline again.
Letās see whether just adding the attribute works with all Drupal versions. Otherwise, weāll probably have to just ignore those errors for now, until we depend on the relevant Drupal Core version.
drunken monkey ā created an issue.
That is a good suggestion, thanks! Itās also the decision we reached in
āØ
Allow excluding unpublished references from index
Active
.
However, could you maybe check whether the MR there already covers this use case, too? It would be better to just solve this issue once for the whole field extraction code. And weāre missing test coverage in either case. (Otherwise, your MR looks good, thanks!)
I think this is fixed now?
Seems reasonable.
Thanks for suggesting this improvement! I agree that in theory it makes sense to add this parameter and pass the plugin definition to supportsIndex()
.
However, there is of course a large problem when adding a new parameter to an interface, namely backwards-compatibility. Weād have to add it in a commented-out way (see #3128548: Add optional parameters to StatementInterface::fetchObject() to be in line with the PDO implementation of the method fetchObject() ā for an example from Core), adapt our implementations and hope that other classes implementing the method will also do that before we change the signature for real in a future 2.0.0 release of the module. (Based on a sentence in the IS of š [11.x] Adjust parameters in interfaces Active , which discusses making that same Core change permanent, it seems like Symfonyās debug classloader will understand this syntax of commenting out parameters, so people might at least get notified.)
While it seems there is still a clear way to do this, it does carry the risk of breaking peopleās code when we release version 2.0.0, and Iām not sure the use case you describe is common enough to warrant this effort and risk. Iām keeping this open for now in case others would be in favor of this change, too, but am currently sceptical about whether we should do this.
Thanks for reporting this issue!
I was not aware of this change, but definitely seems like something we want to support, indeed. I was always a bit peeved that node access was so inconsistent and giving users access to some unpublished nodes always required a bit of magic.
Seems it didnāt really get more consistent, but the system at least now has clearer rules and less magic, which is also nice.
However, needless to say that this is a very sensitive area and we definitely do not want to introduce a bug that would show visitors content to which they do not have access. And since the change was only introcuced in Drupal 11.2 I wonder if we donāt need to also add a version check to make sure we donāt apply this new logic pre-maturely, i.e., in versions of Drupal Core that donāt apply it themselves yet.
It seems like our current test coverage would not catch this problem, but we should make very sure to not introduce any security problems, even in edge cases.
More worryingly, the tests even seem to fail against Drupal 11.2 currently, so please check that out, too.
In any case, thanks again!
drunken monkey ā made their first commit to this issueās fork.
drunken monkey ā made their first commit to this issueās fork.
Merged.
Merged.
Huh, youāre right, good catch! Then I think that is the real bug here, the problem in Index::postSave()
is just a symptom. āNo serverā should definitely be represented as null
, not ''
.
I think we should make sure an index is never saved with ''
as the server ID and probably also provide an update hook that sanitizes existing indexes.
Would it be OK with you if we converted this issue accordingly, or would you prefer a new issue and would be in favor of still adding this check (which Iād argue against, but am prepared to be convinced/outvoted)?
Good to hear, thanks for reporting back!
Merged.
greggles ā credited drunken monkey ā .
Looks good. Merged.
drunken monkey ā created an issue.
Seems the fails unders Drupal 10 are in HEAD already, and it otherwise seems to work well, so merged.
drunken monkey ā created an issue.
Didnāt work either, so letās just fix this in the Search API Page module as we should have done from the beginning. See š Fix deprecation warnings in PHP 8.4 Active .
Success!
OK, that didnāt work either.
Seems like the test environment maybe just doesnāt understand the @dev
version specification? Letās try that ā¦
Seems one potential fix here would be for the server backend plugin to include empty fields in their result items if they tried to retrieve the field, since this means that the item was indexed without a value for that field and explicitly returning the field as empty makes sense.
However, it also makes sense to have a similar setting for the excerpt as for highlighting individual fields, for not loading field values from the database if not already included in the results. So, if you want to provide an MR for that, Iād be open to including this functionality. (Just ārespectingā the existing setting would break sites relying on the existing behavior so I donāt think we can do that.)
Thanks for reporting this problem!
As you already saw by the test failure, the Index
class uses $this->datasourceInstances
as the āsource of truthā for its datasources. Keeping this consistent helps avoid a lot of thorny problems when changing index settings (see
#2638116: Clean up caching of Index class method results (especially fields) ā
for background on this decision). For instance, a similar change as the one for removeDatasource()
would have to be made to addDatasource()
or getDatasourceIds()
would return incorrect data when called after adding a datasource.
However, I guess this doesnāt really apply when the datasource plugins arenāt loaded yet, so maybe using either $datasourceInstances
or $datasource_settings
based on whether the former is initialized would work in all cases. The only ābreakā in functionality would now be that Index::getDatasourceIds()
will never throw an exception, and since that exception wasnāt even documented I guess this is acceptable. As you say, it might even improve performance in rare cases.
Please give the new code in the MR a try!
drunken monkey ā made their first commit to this issueās fork.
Shouldnāt the server
be set to null
instead of ''
? The former means āno serverā, the latter looks to most code like a server with ID ''
.
In your setup, there also seems to be something else going wrong as an index without server cannot be enabled.
If you try to import invalid configuration it is clear that errors will occur, I wouldnāt say that is a bug in the code.
What exactly was the schema error. The default is search_api.default_processor_configuration
, so if you needed to add search_api.fields_processor_configuration
then maybe your processor inherits from FieldsProcessorPluginBase
? In that case, it is expected that you would need to specify that explicitly, we have no way of detecting in the config schema whether a processor inherits from that.
For those processors that just inherit from ProcessorPluginBase
it seems to work fine. For instance, there is no explicit schema for the entity_status
processor.
Seems changes to test_dependencies
might only take effect after they are merged, not when just inside a fork, based on
the docs ā
. So, in the spirit of experimentation, I just merged the MR. Letās see what happens.
drunken monkey ā created an issue.
Seems the deprecation warnings were actually already fixed in Facets, see
š
Deprecations PHP 8.4
Active
. We are just not using the latest dev version of the module, and there hasnāt been a stable release that includes that fix yet.
Letās see, maybe I can get the CI to use the dev version of the module after all.
Thanks a lot for writing the test, looks great!
I just made a few minor changes, now Iād say this is RTBC.
Great to hear, thanks for the feedback!
Merged.
Thanks again, everyone!
Merged.
Running this locally with XDebug enabled makes it immediately clear why PHPUnit fails to finish: The current code actually leads to an infinite loop, as the default method implementation \Drupal\search_api\Backend\BackendPluginBase::setConfiguration()
actually calls $this->server->setBackendConfig()
. Our current code actually already guarded against this, so that the config stays in sync no matter which method you call but you should still never get an infinite loop.
So, letās just remove one condition from the if
check and add the try
/catch
and that should fix all that.
Please test/review again!
Sorry if this is completely off-topic for this issue, but Iām unclear why setting a custom ignore file for deprecations via SYMFONY_DEPRECATIONS_HELPER: "ignoreFile=ā¦"
doesnāt work to prevent those failures in PHP 8.4 anymore? E.g., in this MR I added such a file for ignoring deprecation warnings triggered by a different Drupal module (since it makes no sense to fail on those), but the āphpunit (max PHP version)ā job still fails because of output caused by the deprecation warning.
If there is really currently no way to avoid failing on deprecated code in other contrib modules (except to disable larger swaths of checks such as tests printing output) then Iām very much in favor of adding some mechanism for that. Though Iām not sure whether the proposed changes would actually allow for that or just help you disable failing on output.
drunken monkey ā created an issue.
drunken monkey ā created an issue.
There are currently no PHPCS failures in this module, see the scheduled pipelines.
Agreed that itās important to keep this from becoming common, but probably already covered by the linked documentation. Letās just adapt our tools to spot this.