Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • scolcher Friend
    #198405

    Hi,

    I have a fresh JASocial site installed from the quickstart on a local server with all the sample data.
    It works fine, just as in the Joomlart site demo, except for one thing: whenever I go to an item page, I see a message on top that says

    “Notice: Undefined property: stdClass::$numOfComments in C:xampphtdocsjasocialcomponentscom_k2viewsitemview.html.php on line 264”

    For example, if a go to the menu K2 CATEGORIES->Item Page, a see the following

    I have not altered anything on the installation or after it, so it is exactly the image of the quickstart as it comes with the download.

    Any ideas?

    Thanks,
    Sergio.


    1. Capture-problem-JAsocial
    TomC Moderator
    #537432

    Here is something you can try . . . . .

    Within file path —> /components/com_k2/helpers/utilities.php

    there are multiple lines that look like this:

    $item->image = $item->$image;

    They should be this:

    if($image != 'imagenone')
    {
    $item->image = $item->$image;
    }

    Replacing those should remove the notices (and hopefully make things work better).

    TomC Moderator
    #537439
    scolcher Friend
    #537446

    Hi TomC,

    the $item->image = $item->$image; code replacement did not do the job, but one of the links that you recommended had the answer. Just to register if someone else had the same problem:

    line 264 of …htdocsjasocialcomponentscom_k2viewsitemview.html.php has the following code:

    $total = $item->numOfComments;

    Changing it to:

    if (empty($item->comments))
    $total = 0;
    else
    $total = $item->numOfComments;

    will do the trick

    scolcher Friend
    #537447

    Tom,

    do you think that I should maintain the /components/com_k2/helpers/utilities.php replacement that you suggested anyway or should I go back to the original code?

    Thanks,
    Sergio

    TomC Moderator
    #537448

    <em>@scolcher 430302 wrote:</em><blockquote>Tom,

    do you think that I should maintain the /components/com_k2/helpers/utilities.php replacement that you suggested anyway or should I go back to the original code?

    Thanks,
    Sergio</blockquote>

    Always keep a backup of the original file configuration – just in case.

    You can then try the suggested code fix to see if it works for you. If it does not, you can revert back to the original and we can continue to work on the issue.

Viewing 6 posts - 1 through 6 (of 6 total)

This topic contains 6 replies, has 2 voices, and was last updated by  TomC 10 years, 5 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum