Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID

Glitch in the Search app

edited May 2013 in Apps

I installed the search app, but when I try and run the initial indexing of the website I get the following error:

Fatal error: Call to a member function getType() on a non-object in /home/user/public_html/apps/search/lib/Search.php on line 94


  • Also I'm a bit confused on when to use $var['item'] versus $var->item. Could you explain that a bit or point me to where that is in the documentation? Because I can't seem to find it...

  • I just pushed an update that should get past that error and provide better error output for the initial indexing. Let me know how it goes if you grab the latest master of the search app.

    Do you have an example of where you're unsure whether to use $var['item'] or $var->item?

  • edited May 2013

    This time it gave back "An error occured" string.

    Well I was wondering of they are interchangeable or if they have different uses. Like, I know that $var['item'] is for data array storage, but I'm not sure what the proper usage of $var->item would be. My guess is that it is for functions after a class has been instanced, but i'm not completely sure about that.

    Something else that I found in the events app. I'm getting an XMLHttpRequest cannot load -URL-. Origin -site- is not allowed by Access-Control-Allow-Origin in the javascript console.

    Here's my script snippet from the index.html of the events app.

    $(document).ready(function () {

     $('#events-calendar').fullCalendar ({
      header: {
        left: 'prev,next today',
        center: 'title',
        right: 'month,basicWeek'
      events: {
        url:  '-URL-',
        currentTimezone: 'America/Detroit'

    I'm not sure what's the best way to remedy this...

    side note: markdown code formatting is tricky to get a hang of.

  • The error didn't include an error message? For example, mine also shows "Couldnt connect to host, ElasticSearch down?" because I haven't installed ElasticSearch or configured another backend.

    The use of $var->item is the same as $var['item'] except that you're accessing properties of an object versus values in an associative array. Objects have methods (aka functions) as well as data properties.

  • edited May 2013

    nope, just "An error occurred".

    So (sans practical coding practices) I could arbitrarily use either $var->item or $var['item'] to store a value and both would be valid?

  • Strange that there's no error. What's in your search app config?

    And the data type of a variable (object or array) will determine whether you use one syntax or the other. If you're creating a new object or array, then it would be up to you to determine the best choice.

  • The configuration is the default settings that the app has set when it is downloaded. I just noticed that it uses a 3rd party for search capabilities? Not sure how I would go about with setting those up...

  • If you sign up with these guys they have a pretty generous free account to start (includes 15,000 pages!) and you just have to plug their info into your search app config file to get it working (they use the IndexTank backend). That way you don't have to run your own search database behind the scenes :)

  • edited May 2013

    Alright, it setup and indexed correctly.

    Yup it's working now... just needs some fine tuning. Thanks!

    So any Idea about the Events app not being able to fetch a google calendar feed?

  • Do you mean the Blog: RSS Viewer in the dynamic objects menu?

  • edited May 2013

    no. I've been looking at the Events app and I noticed that it didn't $page->addscript the gcal script from fullcalendar. When I did that, it fixed it and now displays my google calendar. I would suggest either adding native support for gcal through the admin interface, or you can just insert $page->add_script ('< script src="/apps/events/js/fullcalendar/gcal.js">< /script>'); to the index.php and have people add their gcal info like fullcalendar specifies in their documentation.

    Also, is $this->run able to return a value to a $variable?

  • edited May 2013

    I just added support for Google Calendars now too. I had been meaning to add a settings form for the events app, so I just added both at the same time. FullCalendar made the change nice and easy :) Just grab the latest code from the Github page here.

    And yes you can get the output from $this->run like this:

    $output = $this->run ('social/video/youtube', array ('video' => ''));

    That should give you the embeddable HTML instead of echoing it. This is exactly the same as calling it from a template like this:

    {! social/video/youtube?video= !}

    Hope that helps!

  • Awesome! yes that helps a bunch.

Sign In or Register to comment.