Jump to:

7938 Posts in 1540 Topics by 945 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » extending event_calender

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2 3
Go to End
Author Topic: 3332 Views
  • Andre
    Avatar
    Community Member
    126 Posts

    Re: extending event_calender Link to this post

    Found it in CalendarEvents.ss

  • Andre
    Avatar
    Community Member
    126 Posts

    Re: extending event_calender Link to this post

    Hi, I have to come back to my first Problem with extending the calendar Module. I updated to r70 now, but I still got the same Error.

    [User Error] Couldn't run query: SELECT `CalendarDateTime`.*, `ChurchCalendarDateTime`.*, `CalendarDateTime`.ID, if(`CalendarDateTime`.ClassName,`CalendarDateTime`.ClassName,'CalendarDateTime') AS RecordClassName FROM `CalendarDateTime` LEFT JOIN `ChurchCalendarDateTime` ON `ChurchCalendarDateTime`.ID = `CalendarDateTime`.ID WHERE (CalendarID=43 AND StartDate BETWEEN '2009-08-24' AND '2010-02-24' ) AND (`CalendarDateTime`.ClassName IN ('ChurchCalendarDateTime')) ORDER BY StartDate ASC Column 'CalendarID' in where clause is ambiguous
    GET /kalender/

    Line 401 in /usr/www/users/kirchk/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 `CalendarDateTime`.*, `ChurchCalendarDateTime`.*, `CalendarDateTime`.ID, if(`CalendarDateTime`.ClassName,`CalendarDateTime`.ClassName,'CalendarDateTime') AS RecordClassName FROM `CalendarDateTime` LEFT JOIN `ChurchCalendarDateTime` ON `ChurchCalendarDateTime`.ID = `CalendarDateTime`.ID WHERE (CalendarID=43 AND StartDate BETWEEN '2009-08-24' AND '2010-02-24' ) AND (`CalendarDateTime`.ClassName IN ('ChurchCalendarDateTime')) ORDER BY StartDate ASC Column 'CalendarID' in where clause is ambiguous
    Line 401 of MySQLDatabase.php
    * MySQLDatabase->databaseError(Couldn't run query: SELECT `CalendarDateTime`.*, `ChurchCalendarDateTime`.*, `CalendarDateTime`.ID, if(`CalendarDateTime`.ClassName,`CalendarDateTime`.ClassName,'CalendarDateTime') AS RecordClassName FROM `CalendarDateTime` LEFT JOIN `ChurchCalendarDateTime` ON `ChurchCalendarDateTime`.ID = `CalendarDateTime`.ID WHERE (CalendarID=43 AND StartDate BETWEEN '2009-08-24' AND '2010-02-24' ) AND (`CalendarDateTime`.ClassName IN ('ChurchCalendarDateTime')) ORDER BY StartDate ASC | Column 'CalendarID' in where clause is ambiguous,256)
    Line 102 of MySQLDatabase.php
    * MySQLDatabase->query(SELECT `CalendarDateTime`.*, `ChurchCalendarDateTime`.*, `CalendarDateTime`.ID, if(`CalendarDateTime`.ClassName,`CalendarDateTime`.ClassName,'CalendarDateTime') AS RecordClassName FROM `CalendarDateTime` LEFT JOIN `ChurchCalendarDateTime` ON `ChurchCalendarDateTime`.ID = `CalendarDateTime`.ID WHERE (CalendarID=43 AND StartDate BETWEEN '2009-08-24' AND '2010-02-24' ) AND (`CalendarDateTime`.ClassName IN ('ChurchCalendarDateTime')) ORDER BY StartDate ASC,256)
    Line 120 of DB.php
    * DB::query(SELECT `CalendarDateTime`.*, `ChurchCalendarDateTime`.*, `CalendarDateTime`.ID, if(`CalendarDateTime`.ClassName,`CalendarDateTime`.ClassName,'CalendarDateTime') AS RecordClassName FROM `CalendarDateTime` LEFT JOIN `ChurchCalendarDateTime` ON `ChurchCalendarDateTime`.ID = `CalendarDateTime`.ID WHERE (CalendarID=43 AND StartDate BETWEEN '2009-08-24' AND '2010-02-24' ) AND (`CalendarDateTime`.ClassName IN ('ChurchCalendarDateTime')) ORDER BY StartDate ASC)
    Line 426 of SQLQuery.php
    * SQLQuery->execute()
    Line 2407 of DataObject.php
    * DataObject->instance_get(CalendarID=43 AND StartDate BETWEEN '2009-08-24' AND '2010-02-24' ,StartDate ASC,,,DataObjectSet)
    Line 2383 of DataObject.php
    * DataObject::get(ChurchCalendarDateTime,CalendarID=43 AND StartDate BETWEEN '2009-08-24' AND '2010-02-24' ,StartDate ASC)
    Line 346 of Calendar.php
    * Calendar->Events(,sfDate,sfDate,1,,)
    Line 752 of Calendar.php
    * Calendar_Controller->Events()
    * call_user_func_array(Array,Array)
    Line 550 of ViewableData.php
    * ViewableData->cachedCall(Events,,)
    Line 591 of ViewableData.php
    * ViewableData->hasValue(Events)
    Line 82 of .cache.usr.www.users.kirchk.event_calendar.templates.Layout.Calendar.ss
    * include(/usr/www/users/kirchk/silverstripe-cache/.cache.usr.www.users.kirchk.event_calendar.templates.Layout.Calendar.ss)
    Line 354 of SSViewer.php
    * SSViewer->process(ChurchCalendar_Controller)
    Line 346 of SSViewer.php
    * SSViewer->process(ChurchCalendar_Controller)
    Line 175 of Controller.php
    * Controller->handleAction(HTTPRequest)
    Line 129 of RequestHandler.php
    * RequestHandler->handleRequest(HTTPRequest)
    Line 122 of Controller.php
    * Controller->handleRequest(HTTPRequest)
    Line 29 of ModelAsController.php
    * ModelAsController->handleRequest(HTTPRequest)
    Line 277 of Director.php
    * Director::handleRequest(HTTPRequest,Session)
    Line 121 of Director.php
    * Director::direct(/kalender/)
    Line 118 of main.php

    I didn't changed my code of the files I already postet. Is my code realy correct?

  • UncleCheese
    Avatar
    4085 Posts

    Re: extending event_calender Link to this post

    Looks like there was one more fix needed. Update your SVN and try again?

  • Andre
    Avatar
    Community Member
    126 Posts

    Re: extending event_calender Link to this post

    hm, the ChurchCalender Page, I added before does show a working Kalender now in the frontend, but in the backend when selecting or adding a ChurchCalendarPage there pops up a error window. This is the part I was able to copy from it.

    ERROR [User Error]: Couldn't run query:
    SELECT `CalendarDateTime`.*, `ChurchCalendarDateTime`.*, `CalendarDateTime`.ID, if(`CalendarDateTime`.ClassName,`CalendarDateTime`.ClassName,'CalendarDateTime') AS RecordClassName
    FROM `CalendarDateTime`
    LEFT JOIN `ChurchCalendarDateTime` ON `ChurchCalendarDateTime`.ID = `CalendarDateTime`.ID
    WHERE ((is_announcement = 1 AND CalendarID = 47) AND (`CalendarID` = '47')) AND (`CalendarDateTime`.ClassName IN ('ChurchCalendarDateTime'))
    LIMIT 0,10

    Column 'CalendarID' in where clause is ambiguous
    IN POST /admin/getitem?ID=47&locale=de_DE&ajax=1
    Line 401 in /usr/www/users/kirchk/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

    <ul>user_error(Couldn't run query:
    SELECT `CalendarDateTime`.*, `ChurchCalendarDateTime`.*, `CalendarDateTime`.ID, if(`CalendarDateTime`.ClassName,`CalendarDateTime`.ClassName,'CalendarDateTime') AS RecordClassName
    FROM `CalendarDateTime`
    LEFT JOIN `ChurchCalendarDateTime` ON `ChurchCalendarDateTime`.ID = `CalendarDateTime`.ID
    WHERE ((is_announcement = 1 AND CalendarID = 47) AND (`CalendarID` = '47')) AND (`CalendarDateTime`.ClassName IN ('ChurchCalendarDateTime'))
    LIMIT 0,10

    Column 'CalendarID' in where clause is ambiguous,256)
    line 401 of MySQLDatabase.php

    MySQLDatabase->databaseError(Couldn't run query: SELECT `CalendarDateTime`.*, `ChurchCalendarDateTime`.*, `CalendarDateTime`.ID, if(`CalendarDateTime`.ClassName,`CalendarDateTime`.ClassName,'CalendarDateTime') AS RecordClassName FROM `CalendarDateTime` LEFT JOIN `ChurchCalendarDateTime` ON `ChurchCalendarDateTime`.ID = `CalendarDateTime`.ID WHERE ((is_announcement = 1 AND CalendarID = 47) AND (`CalendarID` = '47')) AND (`CalendarDateTime`.ClassName IN ('ChurchCalendarDateTime')) LIMIT 0,10 | Column 'CalendarID' in where clause is ambiguous,256)
    line 102 of MySQLDatabase.php

    MySQLDatabase->query(SELECT `CalendarDateTime`.*, `ChurchCalendarDateTime`.*, `CalendarDateTime`.ID, if(`CalendarDateTime`.ClassName,`CalendarDateTime`.ClassName,'CalendarDateTime') AS RecordClassName FROM `CalendarDateTime` LEFT JOIN `ChurchCalendarDateTime` ON `ChurchCalendarDateTime`.ID = `CalendarDateTime`.ID WHERE ((is_announcement = 1 AND CalendarID = 47) AND (`CalendarID` = '47')) AND (`CalendarDateTime`.ClassName IN ('ChurchCalendarDateTime')) LIMIT 0,10,256)

  • Andre
    Avatar
    Community Member
    126 Posts

    Re: extending event_calender Link to this post

    OK, I'm now on Rev 72 with the following Error.
    Fatal error: Object::add_extension() - Can't find extension class for "CalendarScriptInit" in /usr/www/users/kirchk/sapphire/core/Object.php on line 386

  • UncleCheese
    Avatar
    4085 Posts

    Re: extending event_calender Link to this post

    That's odd. Is the file CalendarScriptInit.php in your code folder?

  • Andre
    Avatar
    Community Member
    126 Posts

    Re: extending event_calender Link to this post

    Ok, I was to fast, so it was my fault.

    The frontend is looking good, but the backend still gets the error Popup.

    ERROR [User Error]: Couldn't run query:
    SELECT `CalendarDateTime`.*, `ChurchCalendarDateTime`.*, `CalendarDateTime`.ID, if(`CalendarDateTime`.ClassName,`CalendarDateTime`.ClassName,'CalendarDateTime') AS RecordClassName
    FROM `CalendarDateTime`
    LEFT JOIN `ChurchCalendarDateTime` ON `ChurchCalendarDateTime`.ID = `CalendarDateTime`.ID
    WHERE ((is_announcement = 1 AND CalendarDateTime.CalendarID = 43) AND (`CalendarID` = '43')) AND (`CalendarDateTime`.ClassName IN ('ChurchCalendarDateTime'))
    LIMIT 0,10

    Column 'CalendarID' in where clause is ambiguous
    IN POST /admin/getitem?ID=43&ajax=1
    Line 401 in /usr/www/users/kirchk/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

    <ul>user_error(Couldn't run query:
    SELECT `CalendarDateTime`.*, `ChurchCalendarDateTime`.*, `CalendarDateTime`.ID, if(`CalendarDateTime`.ClassName,`CalendarDateTime`.ClassName,'CalendarDateTime') AS RecordClassName
    FROM `CalendarDateTime`
    LEFT JOIN `ChurchCalendarDateTime` ON `ChurchCalendarDateTime`.ID = `CalendarDateTime`.ID
    WHERE ((is_announcement = 1 AND CalendarDateTime.CalendarID = 43) AND (`CalendarID` = '43')) AND (`CalendarDateTime`.ClassName IN ('ChurchCalendarDateTime'))
    LIMIT 0,10

    Column 'CalendarID' in where clause is ambiguous,256)
    line 401 of MySQLDatabase.php

    MySQLDatabase->databaseError(Couldn't run query: SELECT `CalendarDateTime`.*, `ChurchCalendarDateTime`.*, `CalendarDateTime`.ID, if(`CalendarDateTime`.ClassName,`CalendarDateTime`.ClassName,'CalendarDateTime') AS RecordClassName FROM `CalendarDateTime` LEFT JOIN `ChurchCalendarDateTime` ON `ChurchCalendarDateTime`.ID = `CalendarDateTime`.ID WHERE ((is_announcement = 1 AND CalendarDateTime.CalendarID = 43) AND (`CalendarID` = '43')) AND (`CalendarDateTime`.ClassName IN ('ChurchCalendarDateTime')) LIMIT 0,10 | Column 'CalendarID' in where clause is ambiguous,256)
    line 102 of MySQLDatabase.php

    MySQLDatabase->query(SELECT `CalendarDateTime`.*, `ChurchCalendarDateTime`.*, `CalendarDateTime`.ID, if(`CalendarDateTime`.ClassName,`CalendarDateTime`.ClassName,'CalendarDateTime') AS RecordClassName FROM `CalendarDateTime` LEFT JOIN `ChurchCalendarDateTime` ON `ChurchCalendarDateTime`.ID = `CalendarDateTime`.ID WHERE ((is_announcement = 1 AND CalendarDateTime.CalendarID = 43) AND (`CalendarID` = '43')) AND

  • Andre
    Avatar
    Community Member
    126 Posts

    Re: extending event_calender Link to this post

    I forgot to mention, I'm on Rev 74 now.

    3332 Views
Page: 1 2 3
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.