Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation out of the box fails #9

Closed
phpetra opened this issue Oct 22, 2015 · 12 comments
Closed

Installation out of the box fails #9

phpetra opened this issue Oct 22, 2015 · 12 comments

Comments

@phpetra
Copy link
Contributor

phpetra commented Oct 22, 2015

@bobdenotter
I did some debugging for the labels extension and have found 2 things:

  • when creating a new project with downloading the latest.tar.gz, installing the extension AND adding
    $this->app['htmlsnippets'] = true;
    on line 246 of [Extension.php[(https://github.com/bolt/labels/blob/master/Extension.php#L246)
    the extension is loaded in the backend and I get the editable grid. And I can edit and save labels.

However trying to use them in the frontend does not work. I get english no matter what I try.
{{ lang }} remains empty.

I have an idea about why it doesn't work from looking at your code earlier so I'll look into that and will create a PR at least for the snippet.

The setup I had earlier today was an installation through creating a project with composer composer create-project bolt/composer-install and maybe because the paths and folders in that installation are are different (or something else?) I could not get the assets loaded in the backend. Adding the htmlsnippets line had no effect.
How to solve this I have no clue. Have you any idea?

@phpetra
Copy link
Contributor Author

phpetra commented Oct 23, 2015

@bobdenotter
I've just had another look and the reason it fails in that installation is because it looks for the assets in the "wrong" place:

"NetworkError: 404 Not Found - http://dev.local/extensions/vendor/bolt/labels/assets/handsontable.full.min.css"
handson...min.css

"NetworkError: 404 Not Found - http://dev.local/extensions/vendor/bolt/labels/assets/handsontable.full.min.js"
handson....min.js


The extension with all it's files get installed in the /extensions dir while the doc_root in this setup is the /public dir.
There is also a /public/extensions folder but that is empty.
Manually creating the desired folders and moving the files there fixes things.

The locations of files and folders when using the composer create project method is different. I think it's better (moving files out of the doc_root) but it is causing this problem. Or is there a setting somewhere that I can manipulate?

@GwendolenLynch
Copy link
Contributor

For Composer based installs to work, in the "extra" section of composer.json you need to add:

    "extra" : {
        "bolt-assets" : "assets/",

@bobdenotter
Copy link
Contributor

@phpetra

However trying to use them in the frontend does not work. I get english no matter what I try.
{{ lang }} remains empty.

Have you tried {{ setlanguage('nl') }} ?

@phpetra
Copy link
Contributor Author

phpetra commented Oct 23, 2015

@GawainLynch
That doesn't seem to change anything. The backend is still looking for the files in:
/extensions/vendor/bolt/labels/assets (which is path /public/extensions/...etc)

I fixed it now by manually coping the files.

@bobdenotter
Yes... you're a bit late to the party: you know I fixed that with the PR in the extension? :-P

@GwendolenLynch
Copy link
Contributor

@phpetra that tells the Composer installer to take an action on install, via composer… see the ExtensionInstaller class in 2.2 (changed in master/2.3).

@phpetra
Copy link
Contributor Author

phpetra commented Oct 23, 2015

@GawainLynch
Aaha! yes, I see.
So re-installing the package should do it.

@phpetra
Copy link
Contributor Author

phpetra commented Oct 23, 2015

@GawainLynch
In that case I think I need to create a new PR cause that extra dir probably needs to be in the composer.json of this labels package, right?
See (https://github.com/bolt/labels/blob/master/composer.json#L23)

@GwendolenLynch
Copy link
Contributor

Yes mate… My apologies, I can absolutely see how easily my comment would, itself, not be easy to interpret for someone that did not have the intimate knowledge of the code base that I do… A fail on my part 😁

@GwendolenLynch
Copy link
Contributor

In that case I think I need to create a new PR

Yes, I am at the top of the naughty list with my extensions for not having this in all of them… Please send one in 👍

@phpetra
Copy link
Contributor Author

phpetra commented Oct 23, 2015

@GawainLynch No problem (or apologies needed). I am discovering things as we go along ;-)

@GwendolenLynch
Copy link
Contributor

Clean up mode… Call out if the two rewrites since this was opened haven't caught everything.

@phpetra
Copy link
Contributor Author

phpetra commented Dec 19, 2016

@GawainLynch Since this was an issue of over a year old, I have no idea anymore ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants