-
Notifications
You must be signed in to change notification settings - Fork 14
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
Rest export for Comulis to be corrected #209
Comments
It is actually the return of the CORS error #113 . https://drupal.stackexchange.com/questions/312414/cors-policy-no-access-control-allow-origin |
Access-Control-Allow-Origin * in .htacess -> to solve the CORS problem (tested on prod side and revert back) (and clear cache)
This will change the comulis website to a 500 error instead of 1 (no cors error anymore) IMPORTANT This change can not be committed it will cause an internal error on the environment dev BUT in does work on the production site. Note that is it not the case right now) The second part of the modification is the following (the REST below page still look the same as it was however) --> I do not see any difference between config for rest services (get is well activated config/services/rest/resource/entity%3Anode/edit --> I do not see any difference in the https://biii.eu/all-content-rest?type=software&field_has_topic_target_id_1%5B%5D=4774&_format=json&source=COMULIS link result @delestro , @joakimlindblad could you have a look please? Maybe I have changed something that you do not support from the comulis website code? (oidgnore the cors error, look at the second part mentionned above) |
Hello, to test you need to go to the comulis software https://www.comulis.eu/correlation-software#search_result but first edit the .htaccess from the server directly ( and add it to .git ignore if it works) to remise the cors error. i think i had no server error this morning ( on prod but i had on gitpod). I will try tomorrow early morning otherwise. We also need to test the fiji search bar which may have the same problem. |
You probably mean this one in 2019 right? In fact, I have never applied this change as it crashed the whole biii.eu (production). See: I guess it's better to set the proper headers for COR as it is explained in the link you found. https://drupal.stackexchange.com/questions/312414/cors-policy-no-access-control-allow-origin In biii, service.yml is bise.service.yml. https://github.com/NEUBIAS/bise/blob/dev/web/sites/default/bise.services.yml In the |
... so I fixed the typo. Please check the comulis side. |
Currently the COMULIS search does not work due to the current CORS policy of the Biii-site, which does not allow external sites to ask for BIII resources. @miura , as commented by @PerrineGilloteaux above, to check if it works you just need to go to https://www.comulis.eu/correlation-software#search_result and click any of the three buttons. When failing, you may also see the following in the browser console (Ctrl-J in Chrome): |
Yes, in deed now the error looks completely different; presumably after you added the mentioned .htaccess line. |
Hi @PerrineGilloteaux , @joakimlindblad I hacked in a very bad way to stream the search results into Comulis, but this should be soon solved in a different way. DETAILS To not forget the current temporal solution, more details are below (also for myself). There are two options for cors.config that are causing the access issue:
.htaccess was temporally added with a line
There seems to be a problem with the type of the second argument within one of the modules for CORS in Drupal. This version is apparently an old one (v1.1), even though there is a much newer version v2.1.1. The error looks like this and also causes similar issues on some other occasions like when changing some configuration. Here is an example of the error when accessing from comulis.eu: https://biii.eu/admin/reports/dblog/event/14667917
As this is saying, the second argument passed to the function vendor/asm89/stack-cors/src/Asm89/Stack/CorsService.php
Even though this will be very temporal, I will try to create a patch with this change to make it a bit easier for restoring the original code later. Currently, I really hard coded and this is not under the control of the composer package manager nor Git. I list the related links in below, which lead us to this temporal solution for further fix.
... so please let this issue be opened for a while... |
You are my hero @miura |
true to [*]. See the issue NEUBIAS#209
@PerrineGilloteaux @albangaignard This fix is in the production site already. |
Following the drupal 9 update, the Rest export view of serach need to be checked since
https://www.comulis.eu/correlation-software#search_result will return Failed retrieving data from biii! 0 -
See also #126
The text was updated successfully, but these errors were encountered: