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
[4][cli] finder:index #38222
[4][cli] finder:index #38222
Conversation
I have tested this item ✅ successfully on 19e0d03 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/38222. |
1 similar comment
I have tested this item ✅ successfully on 19e0d03 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/38222. |
@SharkyKZ the same method is in the API application as well
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/38222. |
This one's a bit different to the api because we can check whether the application implements CMSApplicationInterface instead of CMSWebApplicationInterface (although in truth obviously would be better if the api didn't have that dummy getTemplate method). |
@wilsonge So should I revert RTC and the PR needs to be changed or replaced by a new one? |
I'm not sure. it depends how intrenched the usage is. Like I don't see |
This is a general issue in our override system, which is require Template (it not only about Finder). Defaulting to 'system' template will work, but it just hide the issue. |
@wilsonge this is the call stack |
OK So comes from this #36747 PR which is a new 4.2 feature. So first of all that's caused a regression. Is this CLI working in 4.1? Second of all that PR is setting prepareValue to true. But this is presumably going to index different based on whether it's frontend or backend driven edits causing the index because the active template will be different. Seems like that entire feature is very broken to me? Beyond just the CLI. Tagging @Hackwar for insight as he wrote the code and might be able to give an understanding and @roland-d because looks like 4.2 currently is causing a regression. |
I haven't written the CLI part here. I would have to look into this more deeply. |
It not a Finder issue, it "Template Override" issue. |
This isn't a purely CLI issue. Your rendering the custom field on index - which uses the active template. Not the frontend template. In the CLI that crashes but even if that update comes from the backend seems dodgy to me |
@wilsonge Thanks for the heads-up.
It is not a regression I guess because it fails with the same error on Joomla 4.1.5 for me.
Regression or not, this is something we should fix, ideally before the last beta 3 release tomorrow. @Hackwar Do you have time to look into this? |
OK So sat down with the dev laptop tonight and actually tried doing some reproduction steps and debugging. First of all - with latest 4.2-dev and the test data set installed I can index from CLI just fine. If I then create a custom field and make it searchable it fails. So i'm very confident in 4.2-dev it's related to that fields PR (at least for now - if it fails in 4.1-dev then possible there might be other scenarios we have to look at too). I can't install the same dataset there (because I run 8.1 locally and 4.1.5 doesn't have the PHP8.1 fixes for the test sample set) 4.2-dev: 4.1.5: I think that PR needs reverting if it's not fixed because:
|
@roland-d with 4.1.5 stable it works well for me under the same settings for 4.2 (blog sample data) |
Thank you @wilsonge for your detailed response. I agree, at this point we should revert this PR and take some time to further polish it. @alikon Perhaps it comes from 3PD custom fields, I did not check why it fails, just that it fails. This PR can be closed I guess and the final solution should be in the new PR for indexing custom fields. |
so you will be reverting #36747 and closing this and waiting for a new pr |
@brianteeman That is correct, a new PR needs to be made and give @Hackwar some time to look into this. |
Thanks everybody for your work on this. |
Pull Request for Issue #38214 .
Summary of Changes
get the Template in the Console Application (even if not needed) but like API application
Testing Instructions
from cli run
php cli/joomla.php finder:index
Actual result BEFORE applying this Pull Request
In PluginHelper.php line 46: Call to undefined method Joomla\CMS\Application\ConsoleApplication::getTemplate()
Expected result AFTER applying this Pull Request
finder indexer works