ignivamanish / wordpress-job-manager

Automatically exported from code.google.com/p/wordpress-job-manager
0 stars 0 forks source link

Blog page showing array-key-exists error after installing plugin #370

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Installed plugin
2. Activated plugin on sneakersfit.com
3. Two error messages appear from frontend.php:

Warning: array_key_exists() [function.array-key-exists]: The second argument 
should be either an array or an object in 
/homepages/31/d197945325/htdocs/sneakers/wp-content/plugins/job-manager/frontend
.php on line 137

Warning: array_key_exists() [function.array-key-exists]: The second argument 
should be either an array or an object in 
/homepages/31/d197945325/htdocs/sneakers/wp-content/plugins/job-manager/frontend
.php on line 152

What is the expected output? What do you see instead?
Expect to see my normal blog posts, but see these errors then my blog posts:
Warning: array_key_exists() [function.array-key-exists]: The second argument 
should be either an array or an object in 
/homepages/31/d197945325/htdocs/sneakers/wp-content/plugins/job-manager/frontend
.php on line 137

Warning: array_key_exists() [function.array-key-exists]: The second argument 
should be either an array or an object in 
/homepages/31/d197945325/htdocs/sneakers/wp-content/plugins/job-manager/frontend
.php on line 152

What version of Job Manager are you using?
 0.7.18

What version of WordPress are you using?
3.2.1

Please provide any additional information below.
brad.otto@gmail.com

Original issue reported on code.google.com by brad.o...@gmail.com on 21 Oct 2011 at 10:04

Attachments:

GoogleCodeExporter commented 8 years ago
I am experiencing the same problem on my website: 
http://www.rumar.com/magazine-with-slider/ rochelle@designadvertising.net

Original comment by rochelle...@gmail.com on 25 Oct 2011 at 3:18

GoogleCodeExporter commented 8 years ago
I actually got rid of some of the error messages by checking for an error 
condition within frontend.php...
For example on line 137 where the code was this:

if(array_key_exists( 'jobman_data', $wp_query->query_vars ) && ! 
array_key_exists( 'jobman_page', $wp_query->query_vars ) ) {

I changed to this:
if( ($wp_query) && 
($wp_query->query_vars) && 
(array_key_exists( 'jobman_data', $wp_query->query_vars ) && 
! array_key_exists( 'jobman_page', $wp_query->query_vars ) )) {

But I have not been able to apply the same logic to fix line 152 in the same 
manner without having the content disappear from showing up on my blog and 
other web pages.  Any PHP programmer out there know how to deal with this line 
of code? to fix the array_key issue from line 152:

if(! array_key_exists( 'jcat', $wp_query->query_vars )) {
                if( isset( $wp_query->query_vars['jobman_root_id'] ) )
                    $post = get_post( $wp_query->query_vars['jobman_root_id'] );
                else if( isset( $wp_query->query_vars['page_id'] ) )
                    $post = get_post( $wp_query->query_vars['page_id'] );

                if( $post == NULL || ( ! isset( $wp_query->query_vars['jobman_page'] ) && $post->ID != $options['main_page'] && ! in_array( $post->post_type, array( 'jobman_job', 'jobman_app_form', 'jobman_register' ) ) ) )
                    return $posts;
            }

Original comment by brad.o...@gmail.com on 27 Oct 2011 at 8:43

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
put the this code end of the wp-congig.php

error_reporting(0);

Original comment by kochas...@gmail.com on 19 Dec 2014 at 1:33