EPrints Technical Mailing List Archive
See the EPrints wiki for instructions on how to join this mailing list and related information.
Message: #04809
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
[EP-tech] Re: How to set a field to be multilang (autocomplete)
- To: eprints-tech@ecs.soton.ac.uk
- Subject: [EP-tech] Re: How to set a field to be multilang (autocomplete)
- From: George Mamalakis <mamalos@eng.auth.gr>
- Date: Tue, 29 Sep 2015 17:14:26 +0300
Hi again,
As I promised, I'm back for the autocomplete feature with respect to multilang fields. And the one with the "problem" is the ml_title field. Here's some context: When I replaced the title field in my workflow, I saw that there was an input_lookup_url attribute which was calling the autocomplete script named title_duplicates. The existing entry was: <component><field ref="title" required="yes" input_lookup_url="{$config{rel_cgipath}}/users/lookup/title_duplicates" input_lookup_params="id={eprintid}&dataset=eprint&field=title" /></component> I thought to replace the title string in the url, so I ended up with a line like this: <component><field ref="ml_title" required="yes" input_lookup_url="{$config{rel_cgipath}}/users/lookup/title_duplicates" input_lookup_params="id={eprintid}&dataset=eprint&field=ml_title"/></component> But when I tested it it didn't work. Looking at the POST request I saw that the final call was: http://mysite/cgi/users/lookup/title_duplicates?q=The%20Limits&_text=The%20Limits%20&id=270&dataset=eprint&field=ml_title&field=ml_title&dataobj=270&dataset=eprint Which resulted in an SQL statement like (from my mysql logs): SELECT `eprintid` FROM `eprint` WHERE `eprint_status`='archive' AND `eprintid`!=270 AND `ml_title` IS NOT NULL AND `ml_title` COLLATE utf8_general_ci LIKE 'The Limits%' LIMIT 10 Running it by hand returns the error: ERROR 1054 (42S22): Unknown column 'ml_title' in 'where clause' Indicating clearly that ml_title field does not exist in table eprint. Which is obviously true. So, what's the best way of dealing with this problem? By examining my database, I saw that EPrints created two additional tables for my ml_title field, namely: - eprint_ml_title_lang - eprint_ml_title_text And in my case, eprint_ml_title_text contains the information my script would have to search. So, I could: 1) just copy title_duplicates script to a new one on which I'd make the relevant changes to only look into the specific table and fields and return something analogous to what the script would return, or 2) write a new script from scratch (not sure why), or 3) Do something else that I'm missing and is much more elegant design and development wise. If the answer is (1) (which is most probably the case), any directions would be welcome. And by directions I mean that if someone could tell me which parts to leave out because they won't match in our case, it would be nice. Thanks all in advance, George. On 24/09/2015 01:02 μμ, George Mamalakis wrote:
-- George Mamalakis IT and Security Officer, Electrical and Computer Engineer (Aristotle Univ. of Thessaloniki), PhD (Aristotle Univ. of Thessaloniki), MSc (Imperial College of London) School of Electrical and Computer Engineering Aristotle University of Thessaloniki phone number : +30 (2310) 994379 |
- Follow-Ups:
- [EP-tech] Re: How to set a field to be multilang (autocomplete)
- From: "Field A.N." <af05v@ecs.soton.ac.uk>
- [EP-tech] Re: How to set a field to be multilang (autocomplete)
- References:
- [EP-tech] Re: How to set a field to be multilang
- From: Timothy Miles-Board <timothy.miles-board@ulcc.ac.uk>
- [EP-tech] Re: How to set a field to be multilang (Imports brake)
- From: George Mamalakis <mamalos@eng.auth.gr>
- [EP-tech] Re: How to set a field to be multilang (Imports brake)
- From: Adam Field <af05v@ecs.soton.ac.uk>
- [EP-tech] Re: How to set a field to be multilang (Imports brake)
- From: George Mamalakis <mamalos@eng.auth.gr>
- [EP-tech] Re: How to set a field to be multilang (Imports brake)
- From: Adam Field <af05v@ecs.soton.ac.uk>
- [EP-tech] Re: How to set a field to be multilang (Imports brake)
- From: George Mamalakis <mamalos@eng.auth.gr>
- [EP-tech] Re: How to set a field to be multilang (Imports brake)
- From: Adam Field <af05v@ecs.soton.ac.uk>
- [EP-tech] Re: How to set a field to be multilang (Imports brake)
- From: George Mamalakis <mamalos@eng.auth.gr>
- [EP-tech] Re: How to set a field to be multilang
- Prev by Date: [EP-tech] Possible bug in title_duplicates script?
- Next by Date: [EP-tech] EPrints 3 Request Document Button??
- Previous by thread: [EP-tech] Re: How to set a field to be multilang (Imports brake)
- Next by thread: [EP-tech] Re: How to set a field to be multilang (autocomplete)
- Index(es):