Closed (fixed)
Project:
Search API
Version:
8.x-1.x-dev
Component:
General code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
2 Feb 2022 at 19:30 UTC
Updated:
13 Nov 2022 at 00:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #3
paulocsLets see what the tests bots will say.
Comment #4
paulocsComment #5
sophiavs commentedI will check the errors and adjust
Comment #6
sophiavs commentedSeeing the 8.x-1.x branch the changes required to make the module compatible has already been update on the branch. I beleave this issue can be pass to duplicated.
Comment #7
sophiavs commentedComment #8
attilatilman commentedPatch contains the D10 readiness fixes which are not included in the current dev branch. (reported by upgrade status)
Comment #9
nkoporec@attilatilman I reviewed your patch and found a couple of more issues reported by the drupal rector (see attachment), leaving this as needs work.
Comment #10
attilatilman commentednkoporec, as I mentioned in my last comment the patch is against the current dev branch since it has 5 more commits since the latest release. Those commits already contains changes and D10 fixes, so when you apply the patch on the latest dev version you will see only 2 issues.
1. The first with the pre-render warning, which I did not fix (false error) (If you have a suggestion how to fix it, let me know)
2. The second is the queryTemporary method usage which is fixed here: https://www.drupal.org/project/search_api/issues/3300927
Comment #11
attilatilman commentedComment #13
attilatilman commentedTest failures on core version 9.5 are not related to the D10 readiness changes: https://www.drupal.org/project/search_api/issues/3307032
Comment #15
japerryUpdated locally, and found this failure when trying to enable acquia search:
Will keep working on it. The original issue patch and MR are invalid, so I've rebased and pushed the updates from Attilla in #8 to at least get it to install properly with composer.
Comment #16
japerryRan into a critical issue related to using Database searches with Search API. It implements Temporary Tables, which was removed in Drupal 10. https://www.drupal.org/node/3211781 This was a casualty of sqlite requring use of prefixes for non-qualified table names.
Unfortunately, there is no replacement, and I'm not sure the core devs will be convinced it should be added back in. We have a few options here...
1) Rewrite the database search queries to not require a temporary table (not sure how feasible that is)
2) Write a contrib module that implements temporary tables and have search_api_db depend on it
3) Add the temporary tables code from core directly into search_api_db, without support for sqlite.
Comment #17
japerryHowever, we should not let search_api_db block progress on this issue. Instead, I've marked it as only compatible with Drupal 9. While search_api will still work with composer and the modules can get installed, drupal will stop any site from upgrading to Drupal 10 if this module is being used. I suggest we make this a separate issue.
Comment #18
drunken monkeyThanks a lot for your work on this, everyone!
Just two notes: the task manager service should never use access checks (seems we just missed one spot), and I also wouldn’t explicitly specify the DB module as incompatible to Drupal 10. Most of the module will work fine under Drupal 10, it will just fail in case of specific facets settings. Which, yes, should definitely still be fixed somehow – I think someone mentioned, though, that this might still be fixed in Core after all? But can neither find the conversation nor the issue anymore.
Unfortunately, testing for issue forks still doesn’t work for this project, so please do not use MRs here. (Interesting that it does seem to work for Search API Autocomplete, though.) Uploading a revised patch and interdiff for testing. If only DB tests fail, I’ll commit.
Comment #20
drunken monkeyNo idea what the “Input required” fail is about. Commented out these few lines and created #3313067: Fix behavior of required Views input fields in search forms as a follow-up to avoid holding up Drupal 10 compatibility over this. Also, committed #3262214: Make search_api_autocomplete compatible with Drupal 10 so there should also not be a
composer requireproblem anymore with D10.Comment #22
drunken monkeyComment #24
drunken monkeyComment #25
drunken monkeyComment #26
berdirThe comment you recalled was in #3300927: Remove usage of temporary tables from DB backend. I have no idea where that discussion happened/is happening. There is no mention of an issue related to that in #3304303: Drupal 10.0.0 requirements. Ah, found something now: #3312641: Bring back temporary tables (Connection::queryTemporary()), but as of now, that is not a critical issue and would need the attention of core maintainers.
Comment #27
berdirthis should stay on the drupal class, it's a BC/FC layer between symfony 4 and 6.
There's also this issue about the class properties: #3304531: Fix access level on $offset, $operator properties
Comment #28
drunken monkeyThanks once again for your help! The attached patch should address the remaining problems.
Not sure why
ViewsTestis failing, it might be because of thequeryTemporary()problem, but not sure. Anyways, I wouldn’t let this hold up the commit and release, and just try to figure this out later, when maybe all related modules are also D10 compatible and it’s easier to test.Comment #29
berdir+1 to committing this. That will help modules that have search api integration test (paragraphs and monitoring in my case) getting to green. If you open an issue for that views problem I can maybe have a look at a later time, no promises though.
Comment #31
drunken monkeyGreat, then let’s do that. Committed. Thanks a lot again, everyone!
Here are the follow-up tickets for the failing tests: #3313067: Fix behavior of required Views input fields in search forms, #3313195: Fix failing ViewsTest::testViewSorts() test on Drupal 10. Would be awesome if you could take a look, of course!
Comment #32
OBDev commentedHi,
Since this patch was merged on search_api, search_api in not compatbile with PHP 7.3 anymore due to
"protected $offset;" replaced by "public int $offset = 0;" on src/Plugin/views/query/SearchApiQuery.php
=> see commit https://git.drupalcode.org/project/search_api/-/commit/1bbfe92f8f9805709...
Even with platform set to PHP 7.3 on composer.json, the last version 1.26 of search API is installed, then it breaks the drush config:import command :
[error] ParseError: syntax error, unexpected 'int' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in Composer\Autoload\includeFile() (line 58 of /var/www/html/inokey/web/modules/contrib/search_api/src/Plugin/views/query/SearchApiQuery.php) #0 /var/www/html/inokey/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile('/var/www/html/i...')
#1 [internal function]: Composer\Autoload\ClassLoader->loadClass('Drupal\\search_a...')
So :
- either you have to limit the version of search_api installed by composer to 1.25 when PHP version is 7.3
- either you should not use "public int $offset = 0;" but "public $offset = 0;"
Comment #33
berdir> - either you have to limit the version of search_api installed by composer to 1.25 when PHP version is 7.3
search_api.info.yml is set to require php 7.4 by this patch, apparently that doesn't automatically translate to a corresponding composer.json definition.
Note that instead of this definition, it might also be OK to just remove it entirely, it was only there because the parent did _not_ specify it, and just live with a undefined property warning on D9.
Comment #34
puddyglumViews Bulk Operations module handles the PHP 7.4 requirement by creating two separate minor versions. Currently 4.1 is PHP 7.3 compatible, and 4.2 is PHP 7.4+ compatible. Currently sites that cannot update beyond PHP 7.3 cannot update to the latest security release of Search API.
https://www.drupal.org/project/views_bulk_operations/releases/4.1.6
https://git.drupalcode.org/project/views_bulk_operations/-/compare/4.2.0...
Comment #35
berdirThat would first require a new major version to be able to have semver support.
I agree it's not great, but fwiw php 7.3 is itself long out of security support and if you care about security you really should start there.
The fact that it's not promoted to composer.json is actually kind of an advantage, it should be fairly easy to patch that property and the php requirement out.
Comment #36
andrew.wang commentedJust wanna chime in here - the site I’m working on is hosted on an enterprise environment, which I have no control over the PHP version (7.3). For now, I’ve applied the patch of the security fix to search_api 8.x-1.25.