Skip to content
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

Joomla 4 Api filter tags/categories by alias not working - filter[search] #42503

Closed
aberenguer78 opened this issue Dec 13, 2023 · 1 comment
Closed

Comments

@aberenguer78
Copy link

aberenguer78 commented Dec 13, 2023

Steps to reproduce the issue

I have a problem using the Joomla 4 API.
I'm trying to retrieve the data of a single category or a single tag by the alias because I don't know the id.
The api urls I'm using I have tried both cases filter search that searches title, alias and content text fields. The API url Calls:
{{base_url}}/{{base_path}}/content/categories?filter[search]=blog
And I have filtered by the specific field the alias:
{{base_url}}/{{base_path}}/content/categories?filter[alas]=blog
When I see the results that api returns I can see all the categories I have in joomla but not the one I'm searching.
The same thing happens to me with the tags
{{base_url}}/{{base_path}}/tags?filter[search]=provatag3
{{base_url}}/{{base_path}}/tags?filter[alias]=provatag3
Both queries return all the tags I have in joomla.
I know there's no documentation in the joomla api documentation about filtering but I think it should work. At least searching by alias the articles seems to work.

Expected result

The category or tag with the text or alias searched is shown in the result of the API call.

Actual result

In both cases are shown all the results existing in the joomla db. Categories or tags depending on the request.

System information (as much as possible)

Joomla 4.2.5
PHP 7.4.30
10.4.25-MariaDB
Apache/2.4.54 (Win64)

Additional comments

Inside the joomla api\components\com_content\src\Controller\ArticlesController.php exist the method displaylist that is filtering the search for articles, so for articles we can get the articles searched by text or alias. I think the same should be replicated to the TagsController and to the CategoriesController to have the same feature in the api with not much effort.

@alikon
Copy link
Contributor

alikon commented Dec 14, 2023

please test #42519

@alikon alikon closed this as completed Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants