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

Can't add new folder #3293

Closed
hoaivan opened this issue Mar 28, 2021 · 5 comments
Closed

Can't add new folder #3293

hoaivan opened this issue Mar 28, 2021 · 5 comments
Assignees

Comments

@hoaivan
Copy link

hoaivan commented Mar 28, 2021

Steps:

  1. Run grav from docker according to this: https://github.com/getgrav/docker-grav
  2. Install then activate theme Learn2
  3. Add new folder
  4. Got below error
Stack frames (47)
46
InvalidArgumentException 
…/vendor/rockettheme/toolbox/ResourceLocator/src/UniformResourceLocator.php487
45
RocketTheme\Toolbox\ResourceLocator\UniformResourceLocator find
…/vendor/rockettheme/toolbox/ResourceLocator/src/UniformResourceLocator.php449
44
RocketTheme\Toolbox\ResourceLocator\UniformResourceLocator findCached
…/vendor/rockettheme/toolbox/ResourceLocator/src/UniformResourceLocator.php332
43
RocketTheme\Toolbox\ResourceLocator\UniformResourceLocator findResource
…/user/plugins/flex-objects/classes/Admin/AdminController.php413
42
Grav\Plugin\FlexObjects\Admin\AdminController taskSaveNewFolder
…/user/plugins/flex-objects/classes/Admin/AdminController.php1274
41
Grav\Plugin\FlexObjects\Admin\AdminController execute
…/user/plugins/flex-objects/flex-objects.php271
40
Grav\Plugin\FlexObjectsPlugin onAdminPageInitialized
…/vendor/symfony/event-dispatcher/EventDispatcher.php264
39
Symfony\Component\EventDispatcher\EventDispatcher doDispatch
…/vendor/symfony/event-dispatcher/EventDispatcher.php239
38
Symfony\Component\EventDispatcher\EventDispatcher callListeners
…/vendor/symfony/event-dispatcher/EventDispatcher.php73
37
Symfony\Component\EventDispatcher\EventDispatcher dispatch
…/system/src/Grav/Common/Grav.php556
36
Grav\Common\Grav fireEvent
…/system/src/Grav/Common/Processors/PagesProcessor.php44
35
Grav\Common\Processors\PagesProcessor process
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php50
34
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php62
33
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Common/Processors/TwigProcessor.php38
32
Grav\Common\Processors\TwigProcessor process
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php50
31
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php62
30
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Common/Processors/AssetsProcessor.php39
29
Grav\Common\Processors\AssetsProcessor process
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php50
28
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php62
27
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Common/Processors/SchedulerProcessor.php40
26
Grav\Common\Processors\SchedulerProcessor process
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php50
25
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php62
24
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Common/Processors/BackupsProcessor.php39
23
Grav\Common\Processors\BackupsProcessor process
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php50
22
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php62
21
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Common/Processors/TasksProcessor.php69
20
Grav\Common\Processors\TasksProcessor process
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php50
19
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php62
18
Grav\Framework\RequestHandler\RequestHandler handle
…/user/plugins/admin/classes/plugin/Router.php51
17
Grav\Plugin\Admin\Router process
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php50
16
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php62
15
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Common/Processors/RequestProcessor.php63
14
Grav\Common\Processors\RequestProcessor process
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php50
13
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php62
12
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Common/Processors/ThemesProcessor.php38
11
Grav\Common\Processors\ThemesProcessor process
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php50
10
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php62
9
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Common/Processors/PluginsProcessor.php39
8
Grav\Common\Processors\PluginsProcessor process
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php50
7
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php62
6
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Common/Processors/InitializeProcessor.php130
5
Grav\Common\Processors\InitializeProcessor Grav\Common\Processors\{closure}
…/system/src/Grav/Common/Debugger.php546
4
Grav\Common\Debugger profile
…/system/src/Grav/Common/Processors/InitializeProcessor.php131
3
Grav\Common\Processors\InitializeProcessor process
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php50
2
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php62
1
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Common/Grav.php295
0
Grav\Common\Grav process

/var/www/html/vendor/rockettheme/toolbox/ResourceLocator/src/UniformResourceLocator.php
        // Local caching: make sure that the function gets only called at once for each file.
        $key = $uri .'@'. (int) $array . (int) $absolute . (int) $all;
 
        unset($this->cache[$key]);
    }
 
    /**
     * @param string $scheme
     * @param string $file
     * @param bool $array
     * @param bool $absolute
     * @param bool $all
     * @return array|string|false
     * @throws \InvalidArgumentException
     * @internal
     */
    protected function find($scheme, $file, $array, $absolute, $all)
    {
        if (!isset($this->schemes[$scheme])) {
            throw new \InvalidArgumentException("Invalid resource {$scheme}://");
        }
 
        $results = $array ? [] : false;
        foreach ($this->schemes[$scheme] as $prefix => $paths) {
            if ($prefix && strpos($file, $prefix) !== 0) {
                continue;
            }
 
            // Remove prefix from filename.
            $filename = '/' . trim(substr($file, \strlen($prefix)), '\/');
 
            foreach ($paths as $path) {
                if (\is_array($path)) {
                    // Handle scheme lookup.
                    $relPath = trim($path[1] . $filename, '/');
                    $found = $this->find($path[0], $relPath, $array, $absolute, $all);
                    if ($found) {
                        if (!\is_array($found)) {
                            return $found;
                        }
Arguments
"Invalid resource file://"
Environment & details:
GET Data empty
POST Data
data	
array:3 [▼
  "folder" => "AAAAA"
  "route" => ""
  "blueprint" => ""
]
task	
"saveNewFolder"
admin-nonce	
"2d0d80b76297ff3920f2e461854f65c5"
Files empty
Cookies
frontend_lang	
"en_US"
visitor_uuid	
"ad019faf172c43a396f8171a6982a476"
jwt	
"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiZW1haWwiOiJob2FpdmFuQGdtYWlsLmNvbSIsIm5hbWUiOiJBZG1pbmlzdHJhdG9yIiwiYXYiOm51bGwsInR6IjoiQW1lcmljYS9OZXdfWW9yayI ▶"
adminer_key	
"9f10fd9ab0204b3fee055c086460afd2"
wordpress_test_cookie	
"WP+Cookie+check"
tk_ai	
"woo:TQltZODJD5SfRUzd8En3Z6ip"
adminer_sid	
"7cd863f7a974a9868acd426342cc100c"
store_notice48a83a63040604733c80dffc44b19990	
"hidden"
wp-settings-1	
"libraryContent=browse&editor=tinymce&edit_element_vcUIPanelWidth=650&edit_element_vcUIPanelLeft=614px&edit_element_vcUIPanelTop=82px&advImgDetails=show&posts_li ▶"
wp-settings-time-1	
"1609220155"
JSESSIONID	
"350E73F0F8E2B0D921E0F4E70CA2F94B"
session	
"MTYxNjc0ODU0M3xEdi1CQkFFQ180SUFBUkFCRUFBQVdfLUNBQUlHYzNSeWFXNW5EQW9BQ0hWelpYSnVZVzFsQm5OMGNtbHVad3dIQUFWbWIzTmxZd1p6ZEhKcGJtY01EQUFLWW1GemFXTmZZWFYwYUFaemRISnBi ▶"
gp-premium	
"1"
grav-admin-sidebar	
"true"
grav-admin-flexpages	
"eyJmaWx0ZXJzIjp7fX0="
grav-tabs-state	
"{"tab-content.languages.http_headers.markdown.caching.twig.assets.errors.debugger.media.session.advanced.experimental":"data.twig","tab-content.options.advanced ▶"
grav-site-40d1b2d	
"0ac7b9db19af8c19f7ac597d9a88def8"
grav-site-40d1b2d-admin	
"3c3b333b0d960244a5bb2c78219a5743"
Session
user	
Grav\Common\User\User {#132}
messages	
Grav\Framework\Session\Messages {#134}
expert	
false
redirect_after_login	
false
Server/Request Data
REDIRECT_STATUS	
"200"
HTTP_HOST	
"localhost:8080"
HTTP_CONNECTION	
"keep-alive"
CONTENT_LENGTH	
"124"
HTTP_CACHE_CONTROL	
"max-age=0"
HTTP_UPGRADE_INSECURE_REQUESTS	
"1"
HTTP_ORIGIN	
"http://localhost:8080"
CONTENT_TYPE	
"application/x-www-form-urlencoded"
HTTP_USER_AGENT	
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36"
HTTP_ACCEPT	
"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"
HTTP_SEC_GPC	
"1"
HTTP_SEC_FETCH_SITE	
"same-origin"
HTTP_SEC_FETCH_MODE	
"navigate"
HTTP_SEC_FETCH_USER	
"?1"
HTTP_SEC_FETCH_DEST	
"document"
HTTP_REFERER	
"http://localhost:8080/admin/pages"
HTTP_ACCEPT_ENCODING	
"gzip, deflate, br"
HTTP_ACCEPT_LANGUAGE	
"en-US,en;q=0.9"
HTTP_COOKIE	
"frontend_lang=en_US; visitor_uuid=ad019faf172c43a396f8171a6982a476; jwt=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiZW1haWwiOiJob2FpdmFuQGdtYWlsLmNvbSIsIm5 ▶"
PATH	
"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
SERVER_SIGNATURE	
"<address>Apache Server at localhost Port 8080</address>"
SERVER_SOFTWARE	
"Apache"
SERVER_NAME	
"localhost"
SERVER_ADDR	
"172.31.0.2"
SERVER_PORT	
"8080"
REMOTE_ADDR	
"172.31.0.1"
DOCUMENT_ROOT	
"/var/www/html"
REQUEST_SCHEME	
"http"
CONTEXT_PREFIX	
""
CONTEXT_DOCUMENT_ROOT	
"/var/www/html"
SERVER_ADMIN	
"webmaster@localhost"
SCRIPT_FILENAME	
"/var/www/html/index.php"
REMOTE_PORT	
"42268"
REDIRECT_URL	
"/admin/pages"
GATEWAY_INTERFACE	
"CGI/1.1"
SERVER_PROTOCOL	
"HTTP/1.1"
REQUEST_METHOD	
"POST"
QUERY_STRING	
""
REQUEST_URI	
"/admin/pages"
SCRIPT_NAME	
"/index.php"
PHP_SELF	
"/index.php"
REQUEST_TIME_FLOAT	
1616904817.7527
REQUEST_TIME	
1616904817
argv	
[]
argc	
0
Environment Variables
HOSTNAME	
"e8c8bcc3e329"
PHP_VERSION	
"7.4.16"
APACHE_CONFDIR	
"/etc/apache2"
PHP_INI_DIR	
"/usr/local/etc/php"
GPG_KEYS	
"42670A7FE4D0441C8E4632349E4FDC074A4EF02D 5A52880781F755608BF815FC910DEB46F53EA312"
PHP_LDFLAGS	
"-Wl,-O1 -pie"
PWD	
"/var/www"
APACHE_LOG_DIR	
"/var/log/apache2"
LANG	
"C"
PHP_SHA256	
"1c16cefaf88ded4c92eed6a8a41eb682bb2ef42429deb55f1c4ba159053fb98b"
APACHE_PID_FILE	
"/var/run/apache2/apache2.pid"
PHPIZE_DEPS	
"autoconf \t\tdpkg-dev \t\tfile \t\tg++ \t\tgcc \t\tlibc-dev \t\tmake \t\tpkg-config \t\tre2c"
PHP_URL	
"https://www.php.net/distributions/php-7.4.16.tar.xz"
APACHE_RUN_GROUP	
"www-data"
APACHE_LOCK_DIR	
"/var/lock/apache2"
PHP_EXTRA_CONFIGURE_ARGS	
"--with-apxs2 --disable-cgi"
SHLVL	
"0"
PHP_CFLAGS	
"-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
APACHE_RUN_DIR	
"/var/run/apache2"
APACHE_ENVVARS	
"/etc/apache2/envvars"
APACHE_RUN_USER	
"www-data"
PATH	
"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
PHP_EXTRA_BUILD_DEPS	
"apache2-dev"
PHP_ASC_URL	
"https://www.php.net/distributions/php-7.4.16.tar.xz.asc"
PHP_CPPFLAGS	
"-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
GRAV_VERSION	
"latest"
Registered Handlers
0. Whoops\Handler\PrettyPageHandler
1. Whoops\Handler\CallbackHandler
@XdGoldenTigerOfficial
Copy link

Yeah, I am getting the same error with the same theme. I hope there is a fix for this.

@mahagr mahagr self-assigned this Mar 30, 2021
@XdGoldenTigerOfficial
Copy link

@hoaivan I believe it is an issue with the theme. The way I was able to add folders was to do it manually in the user/pages directory of the webroot.

@mahagr
Copy link
Member

mahagr commented Mar 30, 2021

Could you please explain what did you do, exactly?

@XdGoldenTigerOfficial
Copy link

@mahagr Me Or @hoaivan? For me, I installed the Learn2 Theme, everything worked, I could add pages, but whenever I tried to create folders, the same error showed up for me ^^^.

I decided to create new folders manually in the pages directory of my webroot.

@mahagr mahagr added the bug label Mar 31, 2021
@mahagr
Copy link
Member

mahagr commented Mar 31, 2021

@mahagr mahagr added the fixed label Mar 31, 2021
@mahagr mahagr closed this as completed Apr 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants