enovision / grav-frontend-edit-button

GRAV CMS Plugin - Frontend Edit Button
MIT License
11 stars 6 forks source link

Edit from https site does not work #17

Open rvreugde opened 6 years ago

rvreugde commented 6 years ago

I have a Grav site running with https (e.g. https://mysite.org/my-page). When I push the edit button in a certain page, the page is redirected to https://mysite.org**:80**/admin/pages/my-page.

So, it adds automatically :80, and therefore it does not work. Can the addition of the :80 be removed, or included as an option in the settings?

enovision commented 6 years ago

I have a Grav site running with https (e.g. https://mysite.org/my-page). When I push the edit button in a certain page, the page is redirected to https://mysite.org**:80**/admin/pages/my-page.

So, it adds automatically :80, and therefore it does not work. Can the addition of the :80 be removed, or included as an option in the settings?

There is nowhere in the plugin a direct to a port. In fact I am using the plugin myself on a https secured site. So it must be somewhere in your Grav setup where you have used the :80 port.

enovision commented 6 years ago

I have a Grav site running with https (e.g. https://mysite.org/my-page). When I push the edit button in a certain page, the page is redirected to https://mysite.org**:80**/admin/pages/my-page.

So, it adds automatically :80, and therefore it does not work. Can the addition of the :80 be removed, or included as an option in the settings?

Is this solved with the last update (1.0.12.1)?

rafvandevreugde commented 6 years ago

It still does not work, it still adds :80 to the site. When I just click through the pages, it does not add the :80

In fact, the site is http, but, we acces it through a nginx https gateway.

enovision commented 6 years ago

@rafvandevreugde, I don't know if you're able to check something for me. If you put in the frontend-edit-button.php on top of line:

if (isset($header->editUrl)) {

a dump:

dump($uri);

You should now see some variables from this class.

Here is sample of mine:

Uri {#71 ▼
  +url: "https://notes.enovision.net/directus-headless-cms/filters"
  #scheme: "https"
  #user: null
  #password: null
  #host: "notes.enovision.net"
  #port: null
  #path: "/directus-headless-cms/filters"
  #query: ""
  #fragment: null
  #base: "https://notes.enovision.net"
  #basename: "filters"
  #content_path: "directus-headless-cms/filters"
  #extension: "html"
  #env: "notes.enovision.net"
  #paths: array:2 [▶]
  #queries: []
  #params: []
  #root: "https://notes.enovision.net"
  #root_path: ""
  #uri: "/directus-headless-cms/filters"
  #content_type: null
  #post: null
}

My question to you is now: Is the #base value the same as the #root value? I mean does one is without the "ported 80" extension?

Currently I am using:

if (isset($header->editUrl)) {
    $editUrl = $header->editUrl;
} else {
     $editUrl = $uri->rootUrl(true) . $this->adminRoute . '/pages' . $pageUrl;
}

to determine the path.

rafvandevreugde commented 6 years ago

Hello,

This is the result:

Uri {#66 ▼ +url: "https://ictdocs.ap.be:80/"

scheme: "https"

user: null

password: null

host: "ictdocs.ap.be"

port: 80

path: "/"

query: ""

fragment: null

base: "https://ictdocs.ap.be:80"

basename: ""

content_path: ""

extension: "html"

env: "ictdocs.ap.be"

paths: []

queries: []

params: []

root: "https://ictdocs.ap.be:80"

root_path: ""

uri: "/"

content_type: null

post: null

}

Regards,

Raf van de Vreugde

On 10/25/18 2:24 PM, Enovision GmbH wrote:

@rafvandevreugdehttps://github.com/rafvandevreugde, I don't know if you're able to check something for me. If you put in the frontend-edit-button.php on top of line:

if (isset($header->editUrl)) {

a dump:

dump($uri);

You should now see some variables from this class.

Here is sample of mine:

Uri {#71 ▼ +url: "https://notes.enovision.net/directus-headless-cms/filters"https://notes.enovision.net/directus-headless-cms/filters

scheme: "https"

user: null

password: null

host: "notes.enovision.net"

port: null

path: "/directus-headless-cms/filters"

query: ""

fragment: null

base: "https://notes.enovision.net"https://notes.enovision.net

basename: "filters"

content_path: "directus-headless-cms/filters"

extension: "html"

env: "notes.enovision.net"

paths: array:2 [▶]

queries: []

params: []

root: "https://notes.enovision.net"https://notes.enovision.net

root_path: ""

uri: "/directus-headless-cms/filters"

content_type: null

post: null

}

My question to you is now: Is the #base value the same as the #root value? I mean does one is without the "ported 80" extension?

Currently I am using:

if (isset($header->editUrl)) { $editUrl = $header->editUrl; } else { $editUrl = $uri->rootUrl(true) . $this->adminRoute . '/pages' . $pageUrl; }

to determine the path.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/enovision/grav-frontend-edit-button/issues/17#issuecomment-433029881, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AfnLbHcbE15mK3awnwKQv4Wx5Cj0Gs2zks5uoa2FgaJpZM4XDx1u.