verbb / cp-nav

Control Panel Nav is a Craft CMS plugin to help manage your Control Panel navigation.
MIT License
130 stars 11 forks source link

Install via cli throws error #53

Closed jorenvanhee closed 5 years ago

jorenvanhee commented 5 years ago

Description

The plugin throws an error if you install it through the cli.

$ ./craft install/plugin cp-nav
*** installing cp-nav
    > create table {{%cpnav_layout}} ... done (time: 0.018s)
    > create table {{%cpnav_navigation}} ... done (time: 0.023s)
    > add foreign key cpnav_navigation_layoutId_fk: {{%cpnav_navigation}} (layoutId) references {{%cpnav_layout}} (id) ... done (time: 0.023s)
*** failed to install cp-nav: Calling unknown method: craft\console\Request::getUrl()

Steps to reproduce

  1. composer require verbb/cp-nav
  2. ./craft install/plugin cp-nav

Additional info

nicolasbinet commented 5 years ago

same here.

verbb/cp-nav/src/CpNav.php:80 refers to Craft::$app->getRequest()->getUrl() which is not available on CLI

engram-design commented 5 years ago

Fixed in 2.0.9