iakta / hugocockpit

a Hugo addon for Cockpit-Next CMS, generating Hugo compatible content and running Hugo for you
56 stars 5 forks source link

Next: Redirect after setup doesn't point to subfolder #7

Open raffaelj opened 6 years ago

raffaelj commented 6 years ago

After the setup procedure and clicking "OK, done" I get redirected to http://localhost/dashboard/ instead of http://localhost/cockpit-next/dashboard/.

Windows7, Xampp with PHP7, tested with Firefox and Opera, with a fresh download of cockpit-next

zontarian commented 6 years ago

Sorry, I could not reproduce this behaviour. Just downloaded everything anew today (cockpit + Hugo) and it worked as expected My setup is nginx/PHP7 on Mac Osx.

The only thing weird was that I was already logged with another user, prior to reinstalling everything, and indeed after installing Cockpit i was redirected to the dashboard. After logging out and logging in with the proper user everything was fine.

BTW by cockpit-next, are you referring to the stable or the next gen? I usually download from https://github.com/agentejo/cockpit the master branch

raffaelj commented 6 years ago

Ah, sorry for not mentioning - I use the next branch.

The last commit in the master branch is from 3 months ago. After reading a lot of issues and comparing the cool new features posted on Twitter, it felt like the next branch is the one to use.

zontarian commented 6 years ago

Ok. I’ll investigate the next branch

Walter Gamba walter@iakta.it +39 348 5610576 Iakta srl Via A. Da Montefeltro 2 10134 Torino - Italy

On 7 Jun 2018, at 09:47, Raffael notifications@github.com wrote:

Ah, sorry for not mentioning - I use the next branch.

The last commit in the master branch is from 3 months ago. After reading a lot of issues and comparing the cool new features posted on Twitter, it felt like the next branch is the one to use.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

raffaelj commented 6 years ago

I tested it again with the master branch. It's the same behavior.

Steps to reproduce:

I get redirected to localhost/dashboard instead of localhost/cockpit-next/dashboard. To be sure, I tested it with Opera 53.0 without plugins and with Firefox ESR with script blockers.

So it's not a problem with the next branch.


And now I looked in the code and found the solution here: https://github.com/iakta/hugocockpit/blob/feature/6-checkbox-toggling/views/installer.php#L295

I replaced location.href='..'; with location.href=App.base_url + "/hugo";

I hate these moments, when I test multiple browsers, repos, reinstall everything, think about Apache configurations and then I look at the source, need 5 minutes, change one line and it works.

Should I make a pull request? There are a few lines, which are commented out. So I'm not sure, if you had other plans with the last Done-Redirect. And actually, for a pure redirect it's not neccessary to use a button. It would be more intuitive, if there was a massage with "OK, Done!" with two links below: "Go to Hugo" and "Go to Dashboard".