Jump to content

Module producing ccrazy error in admin when logged in not as superuser


hellomoto
 Share

Recommended Posts

I have reduced the module to this and the same error persists:

<?php

class PortalDashboard extends Process implements Module {

	public static function getModuleInfo() {
		return array(
			'title' => "Portal Dashboard",
			'version' => "0.1",
			//'permission' => array("page-lister"),
			'autoload' => false,
			'singular' => true,
			'permanent' => false,
			'requires' => array("PHP>=5.4.0", "ProcessWire>=3.0", "CatCoCustoms"),
		);
	}

	public function init() {}

In the red:

Quote

User Error
Exception: Unknown Selector operator: '' -- was your selector value properly escaped? field='Array', value='', selector: 'Array, parent_id=31, templates_id=5' (in /Applications/AMPPS/www/caco/wire/core/Selectors.php line 357)

#0 /Applications/AMPPS/www/caco/wire/core/Selectors.php(401): ProcessWire\Selectors->create('Array', '', '')
#1 /Applications/AMPPS/www/caco/wire/core/Selectors.php(158): ProcessWire\Selectors->extractString('Array, parent_i...')
#2 /Applications/AMPPS/www/caco/wire/core/Selectors.php(144): ProcessWire\Selectors->setSelectorString('Array, parent_i...')
#3 /Applications/AMPPS/www/caco/wire/core/PagesLoader.php(188): ProcessWire\Selectors->init('Array, parent_i...')
#4 /Applications/AMPPS/www/caco/wire/core/Pages.php(225): ProcessWire\PagesLoader->find('Array, parent_i...', Array)
#5 [internal function]: ProcessWire\Pages->___find('Array, parent_i...', Array)
#6 /Applications/AMPPS/www/caco/wire/core/Wire.php(374): call_user_func_array(Array, Array)
#7 /Applications/AMPPS/www/caco/wire/core/WireHooks.php(549): ProcessWire\Wire->_callMethod('___find', Array)
#8 /Applications/AMPPS/www/caco/wire/core/Wire.php(399): ProcessWire\WireHooks->runHooks(Object(ProcessWire\Pages), 'find', Array)
#9 /Applications/AMPPS/www/caco/wire/core/PagesLoader.php(370): ProcessWire\Wire->__call('find', Array)
#10 /Applications/AMPPS/www/caco/wire/core/PagesLoader.php(370): ProcessWire\Pages->find('Array, parent_i...', Array)
#11 /Applications/AMPPS/www/caco/wire/core/Pages.php(321): ProcessWire\PagesLoader->get('Array, parent_i...')
#12 /Applications/AMPPS/www/caco/wire/core/PagesType.php(310): ProcessWire\Pages->get('Array, parent_i...', Array)
#13 /Applications/AMPPS/www/caco/wire/core/User.php(223): ProcessWire\PagesType->get(Array)
#14 /Applications/AMPPS/www/caco/wire/core/User.php(166): ProcessWire\User->___hasPagePermission(Array, NULL)
#15 /Applications/AMPPS/www/caco/wire/core/Modules.php(1289): ProcessWire\User->hasPermission(Array)
#16 /Applications/AMPPS/www/caco/wire/modules/PagePermissions.module(547): ProcessWire\Modules->hasPermission('CcPortalDashboa...', Object(ProcessWire\User), Object(ProcessWire\Page), true)
#17 /Applications/AMPPS/www/caco/wire/modules/PagePermissions.module(512): ProcessWire\PagePermissions->processViewable(Object(ProcessWire\Page))
#18 /Applications/AMPPS/www/caco/wire/core/WireHooks.php(629): ProcessWire\PagePermissions->viewable(Object(ProcessWire\HookEvent))
#19 /Applications/AMPPS/www/caco/wire/core/Wire.php(399): ProcessWire\WireHooks->runHooks(Object(ProcessWire\Page), 'viewable', Array)
#20 /Applications/AMPPS/www/caco/wire/modules/AdminTheme/AdminThemeDefault/AdminThemeDefaultHelpers.php(432): ProcessWire\Wire->__call('viewable', Array)
#21 /Applications/AMPPS/www/caco/wire/modules/AdminTheme/AdminThemeDefault/AdminThemeDefaultHelpers.php(432): ProcessWire\Page->viewable()
#22 /Applications/AMPPS/www/caco/wire/modules/AdminTheme/AdminThemeDefault/default.php(86): ProcessWire\AdminThemeDefaultHelpers->renderTopNavItems()
#23 /Applications/AMPPS/www/caco/wire/core/admin.php(174): require('/Applications/A...')
#24 /Applications/AMPPS/www/caco/wire/modules/AdminTheme/AdminThemeDefault/controller.php(13): require('/Applications/A...')
#25 /Applications/AMPPS/www/caco/site/templates/admin.php(19): require('/Applications/A...')
#26 /Applications/AMPPS/www/caco/wire/core/TemplateFile.php(268): require('/Applications/A...')
#27 [internal function]: ProcessWire\TemplateFile->___render()
#28 /Applications/AMPPS/www/caco/wire/core/Wire.php(374): call_user_func_array(Array, Array)
#29 /Applications/AMPPS/www/caco/wire/core/WireHooks.php(549): ProcessWire\Wire->_callMethod('___render', Array)
#30 /Applications/AMPPS/www/caco/wire/core/Wire.php(399): ProcessWire\WireHooks->runHooks(Object(ProcessWire\TemplateFile), 'render', Array)
#31 /Applications/AMPPS/www/caco/wire/modules/PageRender.module(514): ProcessWire\Wire->__call('render', Array)
#32 /Applications/AMPPS/www/caco/wire/modules/PageRender.module(514): ProcessWire\TemplateFile->render()
#33 [internal function]: ProcessWire\PageRender->___renderPage(Object(ProcessWire\HookEvent))
#34 /Applications/AMPPS/www/caco/wire/core/Wire.php(374): call_user_func_array(Array, Array)
#35 /Applications/AMPPS/www/caco/wire/core/WireHooks.php(549): ProcessWire\Wire->_callMethod('___renderPage', Array)
#36 /Applications/AMPPS/www/caco/wire/core/Wire.php(399): ProcessWire\WireHooks->runHooks(Object(ProcessWire\PageRender), 'renderPage', Array)
#37 /Applications/AMPPS/www/caco/wire/core/WireHooks.php(629): ProcessWire\Wire->__call('renderPage', Array)
#38 /Applications/AMPPS/www/caco/wire/core/WireHooks.php(629): ProcessWire\PageRender->renderPage(Object(ProcessWire\HookEvent))
#39 /Applications/AMPPS/www/caco/wire/core/Wire.php(399): ProcessWire\WireHooks->runHooks(Object(ProcessWire\Page), 'render', Array)
#40 /Applications/AMPPS/www/caco/wire/modules/Process/ProcessPageView.module(205): ProcessWire\Wire->__call('render', Array)
#41 /Applications/AMPPS/www/caco/wire/modules/Process/ProcessPageView.module(205): ProcessWire\Page->render()
#42 [internal function]: ProcessWire\ProcessPageView->___execute(true)
#43 /Applications/AMPPS/www/caco/wire/core/Wire.php(374): call_user_func_array(Array, Array)
#44 /Applications/AMPPS/www/caco/wire/core/WireHooks.php(549): ProcessWire\Wire->_callMethod('___execute', Array)
#45 /Applications/AMPPS/www/caco/wire/core/Wire.php(399): ProcessWire\WireHooks->runHooks(Object(ProcessWire\ProcessPageView), 'execute', Array)
#46 /Applications/AMPPS/www/caco/index.php(55): ProcessWire\Wire->__call('execute', Array)
#47 /Applications/AMPPS/www/caco/index.php(55): ProcessWire\ProcessPageView->execute(true)
#48 {main} search►

Furthermore

Quote

Source file

File: /Applications/AMPPS/www/caco/index.php:64

54:        $wire->wire('process', $process);
55:        echo $process->execute($config->internal);
56:        $config->internal ? $process->finished() : extract($wire->wire('all')->getArray());
57:        
58:    } catch(\Exception $e) {
59:        // Formulate error message and send to the error handler
60:        if($process) $process->failed($e);
61:        $wire ? $wire->trackException($e) : $config->trackException($e);
62:        $errorMessage = "Exception: " . $e->getMessage() . " (in " . $e->getFile() . " line " . $e->getLine() . ")";
63:        if($config->debug || ($wire && $wire->user && $wire->user->isSuperuser())) $errorMessage .= "\n\n" . $e->getTraceAsString();
64:        trigger_error($errorMessage, E_USER_ERROR);
65:    }
66:    
67:    

Call stack
Variables
Exception
Environment
HTTP request
HTTP response

    Report generated at 2017/09/03 22:18:50
    http://localhost/caco/portal/page/
    PHP 5.6.21
    Apache/2.4.20 (Unix) PHP/5.6.21 mod_wsgi/3.5 Python/3.5.1 OpenSSL/1.0.1p
    Tracy 2.4.2

When I uninstall the aforementioned module this doesn't happen, oddly enough. What could be the problem?

Link to comment
Share on other sites

Hello @hellomoto,

the module info you provided doesn't produce this error on my installation. I have created a new module file and get only the warning about the missing dependency CatCoCustoms. What is CatCoCustoms? I couldn't find a module with this class name. Or is it a library?

Also you should add the ProcessWire namespace on top of your file as a best practice. ;)

Regards, Andreas

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...