Hi there,

When setting up OSF (manually, not via installer) I noticed two things (until now):

1. The Configure module does actually have dependencies, being for OSF Core and OSF Permissions; May I suggest to add that?

2. The library name provided in the download file is not the same as needed in the Libraries directory. May I suggest to sync that? For instance by rapping the library in a meaningful named zipfile (with version etc) but have the actual directory that is being placed in the Libraries folder named: "OSF-WS-PHP-API".

Also I run into an error regarding open_basedir and CURLOPT_FOLLOWLOCATION. Had to make a workaround but there are many posts for that on the net so juist mention it that it can be a problem.

Thanks so far.
Rgds,
Roeneman

Comments

fgiasson’s picture

Hi!

  1. I did update the info file with the new dependencies. I will commit shortly
  2. Please do give me more information about that: where you get the file, what is produced when unzipped, and what you are expecting.

About open_basedir and CURLOPT_FOLLOWLOCATION please tell me the issues you encountered and how you resolved them. First time I hear that.

Thanks,

Fred

roeneman’s picture

Hi Fred, fast as always, thank :-)

Ad 2. See: https://github.com/structureddynamics/OSF-Web-Services-PHP-API
As mentioned, I would expect the zip download to hold a folder that I directly can copy (without renaming) to the Drupal /sites/all/libraries folder. I see that behavior with lots of other modules and didn't expect to have to rename this.

With regard to CURLOPT_FOLLOWLOCATION, it gives an error when open_basedir is set. The latter is a security measure regularly used by shared hosting providers (as I understand it correctly). Workaround is yet untested so I should not publish, but is inspired on: http://php.net/manual/en/function.curl-setopt.php#102121

Cheers,
Roen

fgiasson’s picture

Hi!

  1. Is now commited
  2. I don't have time to fix it right now, but if you want to then what would be required is to:
    1. Remove all the places in the code where you see "OSF-WS-PHP-API" for "OSF-Web-Services-PHP-API"
    2. Create an upgrade handler that would detect if the "OSF-WS-PHP-API" library is installed, if it is, then to rename the folder to "OSF-Web-Services-PHP-API". That would ensure that previously installed OSF for Drupal instance won't break with that changes.

About the CURLOPT_FOLLOWLOCATION, if you are to release a fix, just create a patch and I will review it.

Thanks!

Fred

roeneman’s picture

Hi Fred, Perhaps a small warning could help the case a lot.

Like in osf.install, after line 80 being:
$requirements['osf_phpapi']['description'] = $t('You must download it from <a href="https://github.com/structureddynamics/OSF-WS-PHP-API/downloads" target="_blank">Github</a> and install it in sites/all/libraries or sites/[sitename]/libraries');

Add:

      #Check if library is installed under the wrong folder, check for common alternatives
      $lib2 = libraries_detect('OSF-Web-Services-PHP-API');
      $lib3 = libraries_detect('OSF-Web-Services-PHP-API-3.1'); 
      if($lib2['installed'] || $lib3['installed'){
        $requirements['osf_phpapi']['description'] .= $t('You might have downloaded the libraries but stored it under an invalid folder like "OSF-Web-Services-PHP-API". Please rename the folder to "OSF-WS-PHP-API" and run update');     
      }
roeneman’s picture

Status: Active » Closed (duplicate)

Closing, provided above suggestion in patch in issue: https://www.drupal.org/node/2410901

fgiasson’s picture

Hi,

About this issue, it is OK to update the requirement hook that way. However, we really need to create an upgrade hook such that when OSF gets updated, that it automatically change the folder name of the currently installed OSF PHP API library.

Also if possible, it would be better to have distinct patches for each issue we are trying to resolve (one for this one, and one for "Global missing for $base_url"

Thanks for working on this!

fgiasson’s picture

Status: Closed (duplicate) » Needs work
fgiasson’s picture

Status: Needs work » Closed (duplicate)