I have a problem while using the sample view "Biblio OAI-PMH" in an HTTP GET request :

The preview in drupal is OK, but an URL constructed with the openarchive protocol (http://www.openarchives.org/OAI/openarchivesprotocol.html), for example http://mysite/oai?verb=Identify, returns the error page :

2011-08-03T14:44:30Z
http://mysite
Do not use them same argument more than once.

Have you an explanation ?

Thanks in advance

Comments

rjerome’s picture

Unfortunately I can't explain that, it should work. I just tried the same URL on my system and it works as expected.

You might try clearing your "views" cache (admin/structure/views/settings/advanced) to see that helps.

rcoffion’s picture

Thank you for your answer.
Unfortunately, the clearing of the views-cache doesn't resolve the problem.
What is the component's version which is working on your system ?

rjerome’s picture

You do need Views 3.x to use this plugin, (probably the latest -dev of both views and ctools is a good idea).

rcoffion’s picture

Here are my versions :
Views 7.x-3.x-dev
Views OAI-PMH 7.x-1.0-beta1
Chaos tools 7.x-1.x-dev

Do you think that's OK ?

rjerome’s picture

Yep, (assuming those -devs are the latest) it looks all good.

What happens if you enter the following...

/oai?verb=ListRecords&metadataPrefix=oai_dc

rcoffion’s picture

With /oai?verb=ListRecords&metadataPrefix=oai_dc :

Do not use them same argument more than once.
The combination of the given values results in an empty list.

rjerome’s picture

Did you change the "path" in the view?

You might try un-installing and re-installing the module.

rcoffion’s picture

1 : no, I keep the default value for the path : Path: /oai
2 : if I re-install the module, what is your recommendation : do I take the version 7.x-1.0-beta1 or 7.x-1.x-dev ?

rjerome’s picture

I don't think there have been any changes to the -dev version since beta1 so they are essentially identical.

rcoffion’s picture

Here is what I did :
- update ctools (rc1)
- uninstall module "Views OAI-PMH"
- reinstall v. 7.x-1.x-dev
- clear views' cache + all caches
- test of /oai?verb=ListRecords&metadataPrefix=oai_dc
- always the same error page :
"Do not use them same argument more than once."
"The combination of the given values results in an empty list."

In the file views_oai_pmh_plugin_display.inc, it seems to be the error code 'sameArgument' (in function oai_error) ??

rjerome’s picture

OK, maybe we need to go outside the module to more detail about your setup.

What OS/Web server/PHP versions are you using?

rcoffion’s picture

I tried :
- Wampserver 2.0 on windows 7 SP1 - AND - apache 2 on debian 6.0
- Both with PHP 5.3.0 and Drupal 7.2

rjerome’s picture

I think the issue is related to the content (or lack there of) of the $_SERVER global.

Try commenting out lines 207 - 210 in views_oai_pmh_plugin_display.inc as shown below...


  function parse_oai_request(){

    $args = array();

    if (!empty($_GET)) {
      $args = $_GET;
//       $getarr = explode('&', $_SERVER['QUERY_STRING']);
//       if (count($getarr) != count($args)) {
//         $this->oai_error('sameArgument');
//       }
    }
    if (!empty($_POST)) {
      $args = $_POST;
    }

rcoffion’s picture

OK, thank you very much : it works !

In your mind, what's the best solution :
- let these lines commented
- put a content on $_SERVER : have you an example ?

rjerome’s picture

Now that you have confirmed that this is the problem, I'm going to remove those lines from the code since they were carried forward from some older code and I don't think they are really necessary in the context of this module.

Cheers,

Ron.

rcoffion’s picture

Status: Active » Closed (fixed)

I hope this will be useful for other users of your very important module.
Many thanks again.
Bye

rjerome’s picture

Status: Closed (fixed) » Active
rcoffion’s picture

Status: Active » Fixed
rcoffion’s picture

Status: Fixed » Closed (fixed)