Opened 3 years ago

Closed 2 years ago

#11375 closed defect (fixed)

Custom OLPC search in local content bundle landing page is broken

Reported by: greenfeld Owned by: manuq
Priority: normal Milestone: 13.1.0
Component: library Version: Development build as of this date
Keywords: Cc: humitos, martin.langhoff, dsd
Blocked By: Blocking:
Deployments affected: Action Needed: no action
Verified: no

Description

The OLPC-specific search on the locally-stored home page that Browse defaults to on XOs (but not upstream) cannot be used without Google claiming it is a source of "automated queries".

This may require an update similar to the one done to the OLPC Wiki's site-specific Google search, as a few months back that had a similar issue.

Seen in 11.3.0 os883.

Attachments (2)

index-olpc2.html (9.0 KB) - added by manuq 3 years ago.
library index.html with the form changed, shows the same result as wiki.laptop.org, but this file is compiled so I have to change the template.
0001-Update-form-for-google-custom-search-in-the-homepage.patch (2.1 KB) - added by manuq 3 years ago.
Patch for olpc-library

Download all attachments as: .zip

Change History (12)

comment:1 Changed 3 years ago by greenfeld

  • Summary changed from Custom OLPC in local content bundle landing page is broken to Custom OLPC search in local content bundle landing page is broken

comment:2 Changed 3 years ago by martin.langhoff

  • Cc humitos added
  • Milestone changed from 11.3.1 to 12.1.0
  • Owner changed from erikos to manuq

11.3.1 has sailed, but we may be on time to fix this for 12.1.0 (it repros on 12.1.0). Manuq, humitos?

My notes: the browser homepage is using the same "custom google search" that wiki.laptop.org used to use. We had this same problem with wiki.l.o, and we changed the search to fix it.

So now a search for "foo" from wiki.l.o works well, and the URL looks like:

http://www.google.com/cse?cx=011382939614944835298:qbypfcvcgvi&q=foo&oq=foo&aq=f&aqi=&aql=&gs_l=partner.3...0.0.1.14.0.0.0.0.0.0.0.0..0.0.gsnos%2Cn%3D13..0.0.&gs_204=2

A search from Browse homepage fails, the URL looks like:
http://www.google.com/custom?hl=en&domains=laptop.org&sitesearch=laptop.org&q=foo&btn1=+%C2%A0%C2%A0Search+%C2%A0OLPC%C2%A0%C2%A0+

Options in my mind

  • Update the search form to the new Google URL with new hidden form values. Will this stay stable for a long time?
  • Update the search form to point to a dev.laptop.org/googlequery?q=<querystr> URL, add an apache mod_rewrite rule that adds the current params and redirects to the google servers with the additional params. If/when the google params change, we can change it at the server.

If you guys prefer the 2nd option, I'll be happy to do the mod_rewrite wranging on the server.

comment:3 Changed 3 years ago by greenfeld

  • Resolution set to fixed
  • Status changed from new to closed

This was fixed as #11773.

comment:4 Changed 3 years ago by dsd

  • Cc martin.langhoff dsd added

Martin's comment says this can be reproduced on 12.1.0. Should this (or the other ticket) be reopened?

comment:5 Changed 3 years ago by manuq

I can see it's not broken for me, I can enter 'foo' in the olpc search box of Browse homepage and the result is the same as performing the search in wiki.laptop.org. However I see a different styled page, with the google mark instead of olpc mark.

So I started copying the html code from wiki.sugarlabs.org, which has the google "new method" for custom search, and started tweaking the stylesheet so it fits in the index.html library. But now I found that there is a <form> method still valid:

https://developers.google.com/custom-search/docs/js/cselement-reference?hl=es#form

Putting the same search engine ID as in wiki.laptop.org in the form gives the same result page, styled with the olpc logo at the top left. I'll continue this way and provide a patch for olpc-library.

Changed 3 years ago by manuq

library index.html with the form changed, shows the same result as wiki.laptop.org, but this file is compiled so I have to change the template.

Changed 3 years ago by manuq

Patch for olpc-library

comment:6 Changed 3 years ago by manuq

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:7 Changed 3 years ago by dsd

  • Action Needed changed from diagnose to review
  • Milestone changed from 12.1.0 to 12.2.0

comment:8 Changed 2 years ago by dsd

  • Action Needed changed from review to add to build
  • Component changed from browse-activity to library

Fixed in olpc-library-2.0.7-1.fc18

comment:9 Changed 2 years ago by dsd

  • Action Needed changed from add to build to test in build

Test in 13.1.0 build 1.

comment:10 Changed 2 years ago by greenfeld

  • Action Needed changed from test in build to no action
  • Resolution set to fixed
  • Status changed from reopened to closed

The OLPC custom search works in Browse in 13.1.0 os1.

Note: See TracTickets for help on using tickets.