As in #1873102: Libraries for "chosen" appear to be missing, I attempted to create a fresh website within a multisite installation, and got an error that implies that a library is missing. Here's the error (with part of my path anonymized):

Warning: file_get_contents(profiles/commerce_kickstart/libraries/jquery.bxSlider/jquery.bxSlider.min.js) [function.file-get-contents]: failed to open stream: No such file or directory in _locale_parse_js_file() (line 1488 of [PATHDELETED]/includes/locale.inc).

The result is that the front-page slider displays as discrete images instead. See attached screenshots.

Given the other issue, I'm starting to think that CK might do something weird with libraries in multisite installations. I'm going to try re-newing CK (i.e., replacing everything except /sites) to see if that fixes it by putting those library files back where they belong.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tgeller’s picture

Indeed: Re-installing Commerce Kickstart appears to have fixed the issue. Not really the answer we're looking for, though... ;)

jsacksick’s picture

Status: Active » Closed (cannot reproduce)

Mark this as cannot reproduce ?

tgeller’s picture

Status: Closed (cannot reproduce) » Active

@jsacksick: Did you attempt to reproduce it in the manner described?

silkogelman’s picture

I'm not doing anything multi-site at all and don't get past the requirement problem during install.
(unless I put Chosen in sites/all/libraries, but that results in Chosen missing in the reports)

I did install and wipe Kickstart once or twice before having this issue.

BrightBold’s picture

#1873102: Libraries for "chosen" appear to be missing has been closed as a duplicate of this issue.

BrightBold’s picture

OK I've figured out what was causing my problem (described in the duplicate issue, above). The following directories in the libraries folder (which in my case I moved from the Kickstart profile to sites/all) are the ones that were empty:

libraries/chosen
libraries/jquery_bxslider
libraries/jquery_expander
libraries/jquery_ui_spinner
libraries/selectnav.js

They all are their own Git repositories — this is why Git is pushing empty folders with no contents.

I'm not sure whether this explains other people's problems or what the desired behavior is (perhaps you're assuming anyone using Git would have Git Submodules and thus get the latest versions of the libraries from outside Kickstart?) but at least that solves the mystery for me.

tgeller’s picture

Thanks for the report.

So (for us git n00bs) what's the solution?

silkogelman’s picture

I am using Git too.
The fact that the missing libraries are partly Git did move me to test with deleting everything git related to them (.gitignore file and .git directory and such) in the past.
That did not solve the problem for me, and it doesn't explain why it does push the files the first time around right?
The fact that they are Git repositories on their own should not matter.

I'll have another go at this Git thingy today.
Maybe some version of commerce_kickstart contained an incorrect .gitignore file somewhere that isn't properly updated or so.

silkogelman’s picture

Update: it does appear to be Git related, Git doesn't seem to add the chosen folder.
(I deleted .gitignore and .git in the chosen folder in this case)

I add files using 'git add -A'.
However, there seems to be something I am overlooking.

silkogelman’s picture

Status: Needs review » Active
FileSize
200.09 KB

Update: this fixed this issue for me:

  • delete all files and commit to git with 'git add -A' (accept for your files folder of course)('git add -A' commits file deletions too)
  • then copy Kickstart 2.1 files to the now empty directory (accept for the sites folder)
  • delete the .git and .gitignore files in chosen module directory
  • commit all files to git

It feels like a workaround - shouldn't the .gitignore file in the profile dir just ignore the git repositories and just add the files?

silkogelman’s picture

Status: Active » Needs review
BrightBold’s picture

Status: Active » Needs review

Aah, thanks@s1l — I was forgetting about -A to remove the .git directory from libraries/chosen on remote so that git would push the files. I was using SFTP as a workaround to get them there.

As for why it works this way, I'm not a git expert so the maintainers would know better than I, but I'm guessing this may have been intentional so that people could get the most recent versions of the libraries from their own repositories. Apparently there's a command, "git submodules," that you can use to have git update both the main repository and any external repos contained within it. So they may have been thinking people would use that. Or it may have been an oversight that they left the .git folders inside those javascript libraries.

But if you need git submodules to make this work with git, they should definitely mention that in the documentation (which, in a shocking, uncharacteristic move, I actually read!) — I've been using git for 2 years and had never heard of git submodules until I started researching this issue, so it's not an obvious solution.

bojanz’s picture

Status: Needs review » Active

None of the libraries included with Kickstart are git repositories, nor do we have any way of replicating git submodules. I'm not even personally fond of that functionality.

@tgeller
What does "multisite" mean in your case? You're using the same Kickstart install to power multiple ecommerce sites?
Or are you trying to "share" a regular Drupal install, or something?

Regardless of multisite, libraries should always be present in profiles/commerce_kickstart/libraries, leading me to believe this is something related to your local setup.

BrightBold’s picture

None of the libraries included with Kickstart are git repositories

I'm not sure what you mean by this. What I'm saying is that if you un-tar a fresh copy of commerce_kickstart-7.x-2.1-no-core.tar.gz or commerce_kickstart-7.x-2.1-core.tar.gz, you will find .git folders in the following directories:

libraries/chosen
libraries/jquery_bxslider
libraries/jquery_expander
libraries/jquery_ui_spinner
libraries/selectnav.js

When you use git to push the Commerce Kickstart files to another machine, the contents of those 5 directories do not get pushed, and thus those scripts aren't present on your remote site. In order to fix this (once you figure out what the heck is causing your slideshow to be totally broken) you have to remove the .git directories from those folders and do a git add . -A to get them deleted from the repository, then re-push to populate those libraries.

I wasn't asking you to include git submodules functionality, only saying that I didn't think what I've described above was how you intended it to be working, and speculating that maybe the module maintainers had git submodules installed and therefore weren't experiencing this problem.

tgeller’s picture

@bojanz: By "multisite", I mean that I'm running one CK installation, with multiple sites in the /sites folder, and a sites.php file to direct traffic.

I also didn't understand what you meant by "None of the libraries included with Kickstart are git repositories", but I'm a git newbie.

Anyway: It's possible it was something in my local setup: I'll post further if it happens again. And if others have this problem, I hope they'll tell about it in this thread. It's working for me now in any case.

dman’s picture

I am certainly able to replicate this.

Steps:
* Unpack the tarball 7.x-2.2
* the folders listed above in /profiles/commerce_kickstart/libraries do come with their own .git subdirectories. eg libraries/chosen/.gi
* Our development process is to now
* init and create a new git repository for this working copy before anything else.. git init, git add *, git commit, git push.
Now we want to start using this in our dev environment
* go to our /var/www etc.
* git clone (our new repo) into (our test location)
* Do the other Drupal setup, then try to run install.php
* the javascript libraries are not here. THey did not come down when I cloned the git repo.

Turns out that when trying to add the whole site in the first place, git saw .git folders in a few place, decided they were submodules, and skipped them,

Either
* it's intentional that these .git folders are part of the tarball and these libraries are supposed to be managed as submodules - which is flatly denied in #13 above
or
* it's accidental and messy, and the tarball should NOT be including .git folders in the subdirectories.

silkogelman’s picture

"This problem occurs when file_get_contents() gets called with an HTTP URL on a server where allow_url_fopen is disabled in php.ini."
in this article about file_get_contents() vs drupal_http_request():
http://www.norio.be/blog/2008/06/filegetcontents-vs-drupalhttprequest

For security reasons some servers have 'allow_url_fopen' disabled:
http://goffgrafix.com/blog/index.php/2010/04/if-your-server-sets-the-allow_url_fopen-and-allow_url_include-php-directives-off/

Update:
Core issue about replacing file_get_contents() with drupal_http_request() regarding locale.inc
#1814980: file_get_contents is used on remote URIs in locale.inc

bojanz’s picture

Title: Library issue in multisite installation: "file_get_contents...No such file or directory in _locale_parse_js_file()" » Libraries should be downloaded from zip files, not cloned from git
Version: 7.x-2.0 » 7.x-2.x-dev

Okay, so let's fix the issue in described in #14, #16, etc. I've reproduced it.
The problem is: we point drush make to github repositories of libraries. Drush make does a git clone and the repositories stay in the package, causing issues.
We should switch the make file to point to the zip files.

bojanz’s picture

Status: Active » Fixed
Damien Tournoud’s picture

Let's also please open an issue against Drush Make (or Drupal.org packaging). We should have a way to specify that we don't want the VCS files to be packaged in the final product.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

YesCT’s picture

Is this a problem again? I've just run into this upgrading kickstart 2.4 to 2.6

YesCT’s picture

must be because I started with 2.4 which had the problem and set up those as submodules in my git.
so I'll just remake the repository from scratch with the current set of files.
that should work.

greenwork’s picture

Ok in simple terms how do you fix this

greenwork’s picture

Ok nm had to just download it from http://harvesthq.github.io/chosen/ the first download option and just unpack it. I believe my server blocked the download if I am not mistaken about the above information.

deltaag’s picture

Issue summary: View changes

I installed version 7.x-2.27 and used git to set a dev server. Problem is solved for libraries/chosen, as there is no .git on that folder, but the other libraries are not copied to dev server:
libraries/jquery_bxslider
libraries/jquery_expander
libraries/jquery_ui_spinner
libraries/selectnav.js

Having allow_url_fopen and allow_url_include both set to On, doesn't seam to do any difference.

Iztok’s picture

I can also confirm that it includes .git in:
profiles/commerce_kickstart/libraries/jquery.bxslider
profiles/commerce_kickstart/libraries/jquery_expander
profiles/commerce_kickstart/libraries/jquery_ui_spinner
profiles/commerce_kickstart/libraries/selectnav.js

deltaag’s picture

Status: Closed (fixed) » Needs work

URL in #19 is not available.

lsolesen’s picture

At some point this was reverted due to getting untagged versions of the libraries. We need tagged versions of a couple of libraries before being able to finish this up.

https://github.com/btburnett3/jquery.ui.spinner/issues/30
https://github.com/lukaszfiszer/selectnav.js/issues/25

I've done initial work on the issue here:

https://github.com/lsolesen/commerce_kickstart/pull/2

wizonesolutions’s picture

Yeah, this is still happening in the latest Commerce Kickstart. I'm not sure of the best way to try to fix this, though. What would the workflow be to check my work?

wizonesolutions’s picture

Workaround (from docroot):

rsync -avz profiles/commerce_kickstart/libraries/ sites/all/libraries/

find sites/all/libraries/ -name ".git" -print0 | xargs -0 rm -rf

Then you can commit the libraries, and the copied versions will be used.

Must be done every time you install/update if you are committing the distro to Git.

TylerMarshall’s picture

@wizonesolutions is it enough to keep the libraries in sites/all/libraries, or are we just doing that to track them properly in VCS?

wizonesolutions’s picture

@Tyler_Marshall: It's enough to keep them there or copy them there as part of a deployment routine. I simply commit and deploy with Git, and since they're ignored in the distro directory, I work around it like this.

rszrama’s picture

Status: Needs work » Closed (outdated)

Commerce Kickstart 2.x is in minimal maintenance mode. Closing out all outdated tickets now to maintain focus on Commerce Kickstart 3.x.