IQSS / dataverse

Open source research data repository software
http://dataverse.org
Other
878 stars 490 forks source link

Unable to search in "latest" and 4.16 versions of the Dataverse guides #6151

Closed jggautier closed 5 years ago

jggautier commented 5 years ago

On the “latest” (http://guides.dataverse.org/en/latest) and “4.16" (http://guides.dataverse.org/en/4.16) versions of the Dataverse Guides, whenever a user uses the search box to search for anything, she gets an error message saying that Javascript needs to be enabled:

Screen Shot 2019-09-09 at 4 36 27 PM

I see this on several desktop and mobile browsers, in regular and incognito mode.

Searching in the guides of any other version (e.g. http://guides.dataverse.org/en/4.15.1) doesn't produce this Javascript error.

pdurbin commented 5 years ago

The Javascript console indicates that jQuery isn't loaded:

Screen Shot 2019-09-10 at 9 15 57 AM

pkiraly commented 5 years ago

Same happens in my browsers, Firefox 69.0 (64-bit) and in Chrome 77.0.3865.75 (Official Build) (64-bit) under Ubuntu 18.04

pdurbin commented 5 years ago

@pkiraly hi! This was fixed in the "develop" branch by pull request #6152 but that doesn't help anyone who is trying to search the 4.16 documentation.

@djbrooke I'm re-opening this to remind us to copy the jquery file over to get search working again.

djbrooke commented 5 years ago

Thanks @pdurbin for tagging me. Just so I understand, you're suggesting copying the file over as a patch in prod so that this gets working independent of the next release?

pdurbin commented 5 years ago

@djbrooke I was wrong. I was hoping we'd be able to just toss a file over in the "4.16" directory but we'll need to to a build to insert the "jquery-3.4.1.min.js" line on every page. That is to say... instead of this...

[plaid@dvnweb-vm3 en]$ grep -r jquery 4.16/user | head -9 4.16/user/account.html: 4.16/user/account.html: 4.16/user/account.html: 4.16/user/index.html: 4.16/user/index.html: 4.16/user/index.html: 4.16/user/find-use-data.html: 4.16/user/find-use-data.html: 4.16/user/find-use-data.html:

... we want something like this:

[plaid@dvnweb-vm3 en]$ grep -r jquery js-dataverse/user | head -9 js-dataverse/user/account.html: js-dataverse/user/account.html: js-dataverse/user/account.html: js-dataverse/user/account.html: js-dataverse/user/index.html: js-dataverse/user/index.html: js-dataverse/user/index.html: js-dataverse/user/index.html: js-dataverse/user/find-use-data.html:

Not a big deal. We would just:

mheppler commented 5 years ago

@pdurbin we do not want two versions of the jQuery javascript file on a single page, as you have shown in your comment.

djbrooke commented 5 years ago

Thanks @pdurbin for the proposal and explanation at standup, and for offering to make this change.

pdurbin commented 5 years ago

@mheppler yes, as we discussed at standup, this is technical debt we should pay down someday.

I made the branch: https://github.com/IQSS/dataverse/tree/6151-4.16-more-jquery

Here are the commands I used:

dhcp-10-250-251-208:dataverse pdurbin$ git checkout v4.16 Note: checking out 'v4.16'.

You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example:

git checkout -b

HEAD is now at a56d550c9 Merge pull request #6129 from IQSS/develop dhcp-10-250-251-208:dataverse pdurbin$ git checkout -b 6151-4.16-more-jquery Switched to a new branch '6151-4.16-more-jquery' dhcp-10-250-251-208:dataverse pdurbin$ git cherry-pick 693adee [6151-4.16-more-jquery dfcace9fa] add jquery to sphinx #6151 Date: Tue Sep 10 09:19:04 2019 -0400 1 file changed, 1 insertion(+) dhcp-10-250-251-208:dataverse pdurbin$ git push origin 6151-4.16-more-jquery

We won't be merging this branch.

Next I'll go do a build.

pdurbin commented 5 years ago

Ok, search should be fixed but please note that you might have to shift-refresh to see the change.

As the "plaid" user (don't ask, see https://github.com/IQSS/plaid ) on the guides server, I ran the following commands:

[plaid@dvnweb-vm3 ~]$ cd /var/www/docs.dataverse.org/en [plaid@dvnweb-vm3 en]$ mv 4.16 4.16.search-broken-6151 [plaid@dvnweb-vm3 en]$ mv 6151-4.16-more-jquery 4.16

@djbrooke can you please take a look?

djbrooke commented 5 years ago

Thanks @pdurbin, works after shift-refresh and in incognito on Chrome. I'm going to re-close this and we'll get the fix out in the next release.

cc: @jggautier