Home Forums Plugin Support WP Project Manager Pro A lot of notices get thrown in frontend

This topic is: not resolved

This topic contains 4 replies, has 2 voices, and was last updated by  Nayem 4 years ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #43103

    Magnus
    Member
    Post count: 1

    A lot of notices get thrown when using the frontend version.

    This happens since CPM_Project::getInstance()->get_projects() returns this:

    array (size=3)
      0 => 
        object(WP_Post)[3426]
          ...
      1 => 
        object(WP_Post)[3468]
          ...
      'total_projects' => string '2' (length=1)

    This is later used in a foreach on row 316 in wedevs-project-manager-frontend-pro/frontend.php:
    if ( !$project_obj->has_permission( $project ) ) { continue; }

    Which obviously fails when $project == int (2) (‘total_projects')

    #43111

    Nayem
    Moderator
    Post count: 6480

    Hello Magnus,

    Actually i am not clear about your problem. Can you please describe me in more details?

    Thanks.

    #43125

    Magnus
    Member
    Post count: 1

    When the [cpm] shortcode is rendering the project list a lot of notices gets thrown:

    • Notice: Trying to get property of non-object in /Users/mien/www/test.dev/web/app/plugins/wedevs-project-manager-pro/class/project.php on line 565
    • Notice: Trying to get property of non-object in /Users/mien/www/test.dev/web/app/plugins/wedevs-project-manager-frontend-pro/frontend.php on line 322
    • Notice: Trying to get property of non-object in /Users/mien/www/test.dev/web/app/plugins/wedevs-project-manager-frontend-pro/frontend.php on line 338

    Here is the relevant stack trace:

    17	0.5973	40790968	CPM_Frontend->shortcode( )	.../shortcodes.php:286
    18	0.5977	40808536	CPM_Frontend->list_projects( )	.../frontend.php:259
    19	0.7282	40932824	CPM_Project->has_permission( )	.../frontend.php:317

    The reason for this is that CPM_Project::getInstance()->get_projects() also include the array-index ‘total_projects' in its return value, and later that record is passed in as the first argument in CPM_Project->has_permission.

    #43232

    Nayem
    Moderator
    Post count: 6480

    Hello,

    I have to discuss with our developer team. Please allow me some time.

    Thanks.

    #43300

    Nayem
    Moderator
    Post count: 6480

    Hello,

    Please do a fresh installation of this plugin. We did not get any error like this and did not get any complain before. You can check our demo- demo.wedevs.com/pm. After reinstalling the plugin if the problem remain then please let me know.

    Thanks.

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

The topic ‘A lot of notices get thrown in frontend’ is closed to new replies.