Problems creating new Calendar Events

Discuss about Group-Office development here

Moderator: Developers

goltratec
Posts: 6
Joined: Tue Mar 08, 2011 7:07 am

Problems creating new Calendar Events

Postby goltratec » Mon Nov 18, 2013 9:19 am

Hi!

I have a client who is using GO for a few years. Now, i have to create a small webpage that has to create new Calendar Events in some predefined calendars. When i try to instantiate a new GO_Calendar_Model_Event i get the following error

Code: Select all

Catchable fatal error: Argument 1 passed to GO_Base_Model_AbstractUserDefaultModel::getDefault() must be an instance of GO_Base_Model_User, boolean given, called in /mylocalpath/intranet/modules/calendar/model/Event.php on line 90 and defined in /mylocalpath/intranet/go/base/model/AbstractUserDefaultModel.php on line 91
Heres the file code:

Code: Select all

require('/mylocalpath/intranet/GO.php');
GO::setIgnoreAclPermissions(true);
$go_intervalo = new GO_Calendar_Model_Event();
The server is running centos 5.4 with Plesk 9, the php version is 5.3.3.

Any idea about how to solve the problem?

Thanks
mschering
Site Admin
Site Admin
Posts: 8281
Joined: Tue Apr 20, 2004 1:06 pm
Location: The Netherlands - Den Bosch
Contact:

Re: Problems creating new Calendar Events

Postby mschering » Tue Nov 19, 2013 11:14 am

Try instead of:

GO::setIgnoreAclPermissions(true);


GO::session()->runAsroot();
Best regards,

Merijn Schering
Intermesh
goltratec
Posts: 6
Joined: Tue Mar 08, 2011 7:07 am

Re: Problems creating new Calendar Events

Postby goltratec » Tue Nov 19, 2013 11:25 am

Thanks for your reply, but it doesn't work

Code: Select all

Fatal error: Call to undefined method GO_Base_Session::runAsroot() in /mypath/citaonline/test.php on line 3
mschering
Site Admin
Site Admin
Posts: 8281
Joined: Tue Apr 20, 2004 1:06 pm
Location: The Netherlands - Den Bosch
Contact:

Re: Problems creating new Calendar Events

Postby mschering » Tue Nov 19, 2013 3:11 pm

Are you on an older version?
Best regards,

Merijn Schering
Intermesh
goltratec
Posts: 6
Joined: Tue Mar 08, 2011 7:07 am

Re: Problems creating new Calendar Events

Postby goltratec » Wed Nov 20, 2013 5:27 pm

I have 4.0.38
mschering
Site Admin
Site Admin
Posts: 8281
Joined: Tue Apr 20, 2004 1:06 pm
Location: The Netherlands - Den Bosch
Contact:

Re: Problems creating new Calendar Events

Postby mschering » Thu Nov 21, 2013 10:07 am

Can't you upgrade to 5?
Best regards,

Merijn Schering
Intermesh
goltratec
Posts: 6
Joined: Tue Mar 08, 2011 7:07 am

Re: Problems creating new Calendar Events

Postby goltratec » Thu Nov 21, 2013 10:14 am

No i can't upgrade. I need to stay with that versión :(
mschering
Site Admin
Site Admin
Posts: 8281
Joined: Tue Apr 20, 2004 1:06 pm
Location: The Netherlands - Den Bosch
Contact:

Re: Problems creating new Calendar Events

Postby mschering » Fri Nov 22, 2013 7:36 am

then you need to login as admin in your script.
Best regards,

Merijn Schering
Intermesh
goltratec
Posts: 6
Joined: Tue Mar 08, 2011 7:07 am

Re: Problems creating new Calendar Events

Postby goltratec » Fri Nov 22, 2013 3:41 pm

Thank you very much, now it's working!!!

Code: Select all

GO::session()->login('myuser', 'mypass');

Who is online

Users browsing this forum: No registered users and 2 guests

cron