huridocs / uwazi

Uwazi is a web-based, open-source solution for building and sharing document collections
http://www.uwazi.io
MIT License
237 stars 79 forks source link

Custom landing page doesn't get results when the URL contains a valid search #6822

Closed mfacar closed 4 months ago

mfacar commented 4 months ago

Describe the bug The home page doesn't show results when the custom landing page includes a filter with encoded chars. For example, a filter by template.

To Reproduce

  1. Go to the Library on an instance with entities, and apply a filter by a template also with entities.
  2. Verify that the search has more than one result and copy the URL in the address bar.
  3. Go to Settings/Collection.
  4. Paste the copied URL into the field Custom landing page and save the changes.
  5. Go to the Uwazi link to go to the home page.
  6. Check that there are no results.

Expected behavior The results on the home page must match with the results of step 1.

Zasa-san commented 4 months ago

I did a quick test on this in the demo instance and it seems to be working when filtering by a template. Are there any specific ways in which this filter needs to be applied or copied?

mfacar commented 4 months ago

@Zasa-san, I just tested it on demo and it doesn't work, for example, after changing the Landing Page to /en/library/?q=(allAggregations:!t,filters:(),from:0,includeUnpublished:!t,limit:30,order:asc,sort:title,treatAs:number,types:!(%2762e909bbf77c451df38e95da%27,%275bfbb1a0471dd0fc16ada146%27),unpublished:!f) and go to Home through the link or directly to https://demo.uwazi.io/ it shows the library but without results as it is in this screenshot

image

The expected output was this search)

mfacar commented 4 months ago

For the record, after testing with @Zasa-san, we found that the issue is observable in Chrome browsers when the search params are copied from the address bar where the URL is already encoded, a behavior that is not true for Firefox.

salvalacruz commented 3 months ago

Hi, I think this issue needs to be checked in staging:

Right now, using the instance https://right.staging.uwazi.io/, I'm not allowed to paste an URL in the Custom landing page at Collection settings:

image

Zasa-san commented 3 months ago

Hi, I think this issue needs to be checked in staging:

Right now, using the instance https://right.staging.uwazi.io/, I'm not allowed to paste an URL in the Custom landing page at Collection settings:

image

Thanks Salva for reporting this! I can confirm this problem on other staging instances. I think this could be a problem with an update that recently occurred in our sating instances configuration. I will reach out to the infra team to confirm.