Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

New module - Simplify - customise the CMS interface


Go to End


46 Posts   14739 Views

Avatar
froog

Community Member, 43 Posts

22 October 2009 at 4:23pm

UPDATED VERSION 0.0.3

Hi guys,

I've changed the way Simplify permissions interact with standard permissions, it should resolve some problems.

Download it from here:

http://inject.gotdns.com/simplify/

dospuntocero, this should fix your issue.

kevino, this *might* fix your issue, let me know how it goes.

Avatar
dospuntocero

Community Member, 54 Posts

22 October 2009 at 4:25pm

amazing! you're tha men!!!

Avatar
kevino

Community Member, 30 Posts

22 October 2009 at 11:07pm

Edited: 01/04/2011 12:17pm

Daniel,

Thanks for looking further into this.

The version 0.0.3 you most recently posted does solve the login issue, and works well.
However - the "Load Tree" button in the fields tab doesn't seem seem to work. The other functions do.

Back with 0.0.4, the error I'm receiving in dev mode is

[User Error] Couldn't run query: SELECT `Permission`.*, `SimplifyPermission`.*, `Permission`.ID, if(`Permission`.ClassName,`Permission`.ClassName,'Permission') AS RecordClassName FROM `Permission` LEFT JOIN `SimplifyPermission` ON `SimplifyPermission`.ID = `Permission`.ID WHERE (`Code` = 'ADMIN') ORDER BY ID LIMIT 1 Column 'Code' in where clause is ambiguous
POST /zzzzzzzzzzzzzzzz.co.uk/silverstripe/Security/LoginForm

Line 401 in /home/zzzzzzzzzzzzzzzzzzzzzzzzzzzz/public_html/zzzzzzzzzzzzzzzzzzzzzzzzzzzz.co.uk/silverstripe/sapphire/core/model/MySQLDatabase.php
Source

392 	}
393 	
394 	function databaseError($msg, $errorLevel = E_USER_ERROR) {
395 		// try to extract and format query
396 		if(preg_match('/Couldn\'t run query: ([^\|]*)\|\s*(.*)/', $msg, $matches)) {
397 			$formatter = new SQLFormatter();
398 			$msg = "Couldn't run query: \n" . $formatter->formatPlain($matches[1]) . "\n\n" . $matches[2];
399 		}
400 		
401 		user_error($msg, $errorLevel);
402 	}
403 }
404 
405 /**
406  * A result-set from a MySQL database.
407  * @package sapphire

Trace

    * Couldn't run query: SELECT `Permission`.*, `SimplifyPermission`.*, `Permission`.ID, if(`Permission`.ClassName,`Permission`.ClassName,'Permission') AS RecordClassName FROM `Permission` LEFT JOIN `SimplifyPermission` ON `SimplifyPermission`.ID = `Permission`.ID WHERE (`Code` = 'ADMIN') ORDER BY ID LIMIT 1 Column 'Code' in where clause is ambiguous
      Line 401 of MySQLDatabase.php
    * MySQLDatabase->databaseError(Couldn't run query: SELECT `Permission`.*, `SimplifyPermission`.*, `Permission`.ID, if(`Permission`.ClassName,`Permission`.ClassName,'Permission') AS RecordClassName FROM `Permission` LEFT JOIN `SimplifyPermission` ON `SimplifyPermission`.ID = `Permission`.ID WHERE (`Code` = 'ADMIN') ORDER BY ID LIMIT 1 | Column 'Code' in where clause is ambiguous,256)
      Line 102 of MySQLDatabase.php
    * MySQLDatabase->query(SELECT `Permission`.*, `SimplifyPermission`.*, `Permission`.ID, if(`Permission`.ClassName,`Permission`.ClassName,'Permission') AS RecordClassName FROM `Permission` LEFT JOIN `SimplifyPermission` ON `SimplifyPermission`.ID = `Permission`.ID WHERE (`Code` = 'ADMIN') ORDER BY ID LIMIT 1,256)
      Line 120 of DB.php
    * DB::query(SELECT `Permission`.*, `SimplifyPermission`.*, `Permission`.ID, if(`Permission`.ClassName,`Permission`.ClassName,'Permission') AS RecordClassName FROM `Permission` LEFT JOIN `SimplifyPermission` ON `SimplifyPermission`.ID = `Permission`.ID WHERE (`Code` = 'ADMIN') ORDER BY ID LIMIT 1)
      Line 426 of SQLQuery.php
    * SQLQuery->execute()
      Line 2527 of DataObject.php
    * DataObject->instance_get_one(`Code` = 'ADMIN',ID)
      Line 2464 of DataObject.php
    * DataObject::get_one(Permission,`Code` = 'ADMIN',1,ID)
      Line 584 of Security.php
    * Security::findAnAdministrator()
      Line 28 of MemberAuthenticator.php
    * MemberAuthenticator::authenticate(Array,MemberLoginForm)
      Line 199 of MemberLoginForm.php
    * MemberLoginForm->performLogin(Array)
      Line 118 of MemberLoginForm.php
    * MemberLoginForm->dologin(Array,MemberLoginForm,HTTPRequest)
      Line 246 of Form.php
    * Form->httpSubmission(HTTPRequest)
      Line 129 of RequestHandler.php
    * RequestHandler->handleRequest(HTTPRequest)
      Line 143 of RequestHandler.php
    * RequestHandler->handleRequest(HTTPRequest)
      Line 122 of Controller.php
    * Controller->handleRequest(HTTPRequest)
      Line 277 of Director.php
    * Director::handleRequest(HTTPRequest,Session)
      Line 121 of Director.php
    * Director::direct(/Security/LoginForm)
      Line 118 of main.php

I hope this helps

K

Avatar
froog

Community Member, 43 Posts

23 October 2009 at 9:46am

Edited: 23/10/2009 9:48am

Hi kevino - there is no version 0.0.4 - for some reason the forum incremented the version number when I attached it (grr) - the latest version is 0.0.3 from http://inject.gotdns.com/simplify/ , you should use that.

That will solve the database error you're seeing, meaning the only issue you have is the Load Tree.
To diagnose this:

Install v0.0.3 and do a dev/build?flush=1
Use Firefox with the Firebug plugin (http://getfirebug.com/)
Go to the Fields tab
Open up Firebug and click the 'Net' tab, and click 'Clear'
Click the "Load Tree" button
A entry called "GET administrators" should appear in the Net panel - expand it and click the "Response" tab
Copy that content and paste or attach it to a post so I can diagnose it.

Also click the "Console" tab and see if you're getting any Javascript errors (in red) and post them too.

Cheers,
Dan

Avatar
kevino

Community Member, 30 Posts

23 October 2009 at 10:31pm

Edited: 01/04/2011 12:17pm

Hi Dan,

Yes, the only error I'm getting (that I can tell) is to do with the Load Field Tree on 0.0.3..

I've done as suggested, and the Firebug results are:

GET test-admin

ERROR [User Error]: Uncaught Exception: Object->__call(): the method 'name' does not exist on 'Test'
IN GET /zzzzzzzzzzzzzzzzzzz.co.uk/silverstripe/admin/simplify/drawTree/test-admin
Line 551 in /home/zzzzzzzzzzzzzzzzzzzz/public_html/zzzzzzzzzzzzzzzzzzzz.co.uk/silverstripe/sapphire/core/Object.php

Source
======
  542: 				case isset($config['function']) :
  543: 					return $config['function']($this, $arguments);
  544: 				
  545: 				default :
  546: 					throw new Exception (
  547: 						"Object->__call(): extra method $method is invalid on $this->class:" . var_export($config,
       true)
  548: 					);
  549: 			}
  550: 		} else {
* 551: 			throw new Exception("Object->__call(): the method '$method' does not exist on '$this->class'");
  552: 		}
  553: 	}
  554: 	
  555: 	//
       -----------------------------------------------------------------------------------------------------------------
  556: 	
  557: 	/**

<ul></ul>

In console:

$("perm-tree") is null
anonymous() simplify...256210208 (line 33)
anonymous() jquery.j...227675043 (line 734)
anonymous() jquery.j...227675043 (line 138)
anonymous() jquery.j...227675043 (line 2474)
anonymous() jquery.o...234316538 (line 167)
processOnDemandHeaders(XMLHttpRequest readyState=4 status=500, function()) jquery.o...234316538 (line 231)
anonymous() jquery.o...234316538 (line 173)
complete() jquery.j...227675043 (line 2828)
anonymous() jquery.j...227675043 (line 2778)

Best,
Kevin

Avatar
froog

Community Member, 43 Posts

23 October 2009 at 11:53pm

Hi Kevin,

It seems you've got a class Test.php which is causing some issues.
I've modified the tree code with some better error handling - try installing v0.0.5 from here:

http://idea.gotdns.com/simplify/

If that doesn't help, copy the contents of Test.php into pastie.org and link it in

Cheers,
Dan

Avatar
kevino

Community Member, 30 Posts

24 October 2009 at 1:16am

Edited: 24/10/2009 1:18am

Hi Dan,

Sorry - the test.php didn't even cross my mind. I thought that was in relation to the group I had setup which I originally called Test Admin, and thought the second word was dropping..

The Test.php was basically a really early mashed-up version of Page.php - before we really knew the structure of silverstripe.
looked like this: http://pastie.org/666548
ie, it was on a same level as Page.php if that makes sense.
It's not in use at all, so had forgotten it was still knocking around.

So, I removed Test.php from the server and 0.0.3 worked fine. - Really sorry to have wasted your time with my own error.

0.0.5 also works fine.

Many thanks for your support with this Dan. Simplify really is looking great so far.

Avatar
bmc38119

Community Member, 45 Posts

24 October 2009 at 5:59am

anybody noticed a problem with the drill-down in the site tree after installing simplify? the only options i am using under simplify are hiding certain page classes from the Create menu. but you can see from the screenshot that the icons are gone and drilling down acts very strange and requires a refresh of the page. i have cleared cache and tried all that - but does not clear the problem.

Attached Files