getgrav / grav-skeleton-deliver-site

Grav Deliver Site Skeleton
https://getgrav.org
MIT License
28 stars 30 forks source link

JSComments must be protected #13

Closed Ryuno-Ki closed 8 years ago

Ryuno-Ki commented 8 years ago

Currently https://github.com/bobolopolis/grav-plugin-jscomments is part of your Skeleton.

Opening the /admin Interface as Admin I get:

 Whoops \ Exception \ ErrorException (E_COMPILE_ERROR)

Access level to Grav\Plugin\JSCommentsPlugin::mergeConfig() must be protected (as in class Grav\Common\Plugin) or weaker
Stack frames (1):
0 Whoops\Exception\ErrorException
…/­user/­plugins/­jscomments/­jscomments.php0
/vagrant/src/user/plugins/jscomments/jscomments.php

    <?php namespace Grav\Plugin;

    use Grav\Common\Page\Page;
    use Grav\Common\Plugin;

    class JSCommentsPlugin extends Plugin
    {
      public static function getSubscribedEvents() {
        return [
          'onPluginsInitialized' => ['onPluginsInitialized', 0]
        ];
      }

      public function onPluginsInitialized()
      {
        if ( $this->isAdmin() ) {
          $this->active = false;
          return;
        }
Environment & details:
GET Data empty
POST Data empty
Files empty
Cookies
grav-site-SHORTHASH "LONGHASH"
grav-site-SHORTHASH-admin "LONGHASH"

Session
user User {▼
  #gettersVariable: "items"
  #items: array:9 [▶]
  #blueprints: Blueprint {#1 ▶}
  #storage: CompiledYamlFile {▶}
}

expert true

messages Message {▼
  #messages: []
}

/mytitle array:6 [▼
  "title" => "MYTITLE"
  "folder" => "mytitle"
  "visible" => ""
  "blueprint" => "pages/new"
  "name" => "modular"
  "route" => "/"
]

lastPageName "modular"
lastPageRoute "/"

Server/Request Data
USER "MYUSER"
HOME "MYHOME"
FCGI_ROLE "RESPONDER"
QUERY_STRING ""
REQUEST_METHOD "GET"
CONTENT_TYPE ""
CONTENT_LENGTH ""
SCRIPT_FILENAME "MYDOCROOT/index.php"
SCRIPT_NAME "/index.php"
REQUEST_URI "/admin"
DOCUMENT_URI "/index.php"
DOCUMENT_ROOT "MYDOCROOT"
SERVER_PROTOCOL "HTTP/1.1"
GATEWAY_INTERFACE "CGI/1.1"
SERVER_SOFTWARE "nginx/1.X.Y"
REMOTE_ADDR "192.168.MMM.NNN"
REMOTE_PORT "MYPORT"
SERVER_ADDR "192.168.XXX.YYY"
SERVER_PORT "80"
SERVER_NAME "MYLOCALSERVER"
REDIRECT_STATUS "200"
HTTP_HOST "MYLOCALGRAVINSTANCE"
HTTP_USER_AGENT "Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0"
HTTP_ACCEPT "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
HTTP_ACCEPT_LANGUAGE "en-US,en;q=0.5"
HTTP_ACCEPT_ENCODING "gzip, deflate"
HTTP_DNT "1"
HTTP_COOKIE "grav-site-SHORTHASH=LONGHASH; grav-site-SHORTHASH-admin=LONGHASH"
HTTP_CONNECTION "keep-alive"
HTTP_CACHE_CONTROL "max-age=0"
PHP_SELF "/index.php"
REQUEST_TIME_FLOAT 1460992421.1695
REQUEST_TIME 1460992421

Environment Variables empty
Registered Handlers
0. Whoops\Handler\PrettyPageHandler
1. Whoops\Handler\CallbackHandler

I wonder why you don't use the officiel https://github.com/getgrav/grav-plugin-comments?

flaviocopes commented 8 years ago

That plugin needs to be updated, so please report this issue on that plugin's repository.

The skeleton uses it as GetGrav's Comments was not yet started when this skeleton was built.

Ryuno-Ki commented 8 years ago

I reported it.

But since you ship with a buggy plugin I wanted to raise your awareness to it. You may want to evaluate to switch to another Plugin (JSComments isn't even listed as Plugin at getgrav.org!). On the other hand, the other repo above is developed by the Grav team itself so will probably be maintained in the future.

rhukster commented 8 years ago

Yah the plugin was recently pulled due to lack of support. We'll update the skeleton to use Grav's comments plugin in the near future. Thanks.

bobolopolis commented 8 years ago

My repo for JSComments (https://github.com/bobolopolis/grav-plugin-jscomments) was originally forked from @namaless to fix some minor issues, but it appears the upstream repo has been deleted. I don't use this plugin anymore and don't intend to maintain it, so pulling it is the right decision.

flaviocopes commented 8 years ago

Ok a bit of confusion then, the original jscomments plugin repo was removed from GitHub, but the skeleton still ships with it.

We'll have to update the skeleton to use our own Comments plugin then, in the next update, or create our own GetGrav version of the JSComments plugin.

flaviocopes commented 8 years ago

Repening to keep track 👍

flaviocopes commented 8 years ago

Well, I'll close and open a separate issue