A lot of notices get thrown in frontend

This topic contains 4 reply and 2 voices, and was last updated by Nayem 8 years, 11 months ago
Viewing 4 Posts - 1 through 4 (of 4 total)
Author Posts
May 5, 2015 at 1:39 pm 43103
Nayem 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')
May 5, 2015 at 2:57 pm 43111
Nayem Nayem

Hello Magnus,

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

Thanks.

May 5, 2015 at 4:24 pm 43125
Magnus Magnus

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.

May 6, 2015 at 6:14 pm 43232
Nayem Nayem

Hello,

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

Thanks.

May 7, 2015 at 12:32 pm 43300
Nayem Nayem

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 4 Posts - 1 through 4 (of 4 total)