Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
array_key_exists ERROR updating to GS 3.2.1
#1
Updating my site from GS 3.2.0 to GS 3.2.1
at line of my template
PHP Code:
echo date('j/m/y',strtotime(returnPageField('namepage','pubDate'))); 
it shows this message:
PHP Code:
Warningarray_key_exists() [function.array-key-exists]:
The second argument should be either an array or an object in
D
:\Inetpub\webs\my_site\admin\inc\caching_functions.php on line 114 

Any help?
My website made with GetSimple CMS is

Arte & Società
www.artesocieta.eu

An indipendent website about Italian Contemporary Visual Arts
Reply
#2
Where in your template is this, so i can reproduce.

Also does namepage exist ? Is that the exact code ? and only error ?
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#3
Hi again shawn,
then I waited and I tried even with the new GS version 3.2.3 but nothing to do, it shows the same error...
PHP Code:
Warningarray_key_exists() [(function.array-key-exists)]:
The second argument should be either an array or an object in
D
:\Inetpub\webs\my_site\admin\inc\caching_functions.php on line 52 
at these lines....
PHP Code:
<?php getPageField($pagina,'pubDate'); ?>
<?php getPageField
($pagina,'title'); ?>
<?php getPageField
($pagina,'metad'); ?>
but weirdly not on this line...
PHP Code:
<?php getPageField($pagina,'content'); ?>
Instead wirg gs version 3.2.0 I have no problem.
Any help???
My website made with GetSimple CMS is

Arte & Società
www.artesocieta.eu

An indipendent website about Italian Contemporary Visual Arts
Reply
#4
If I had to guess $pagina is not set to anything.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#5
Ah no sorry, that is one of my last try....
The real lines are these...
PHP Code:
<?php getPageField('centerfold','pubDate'); ?>
<?php getPageField
('centerfold','title'); ?>
<?php getPageField
('centerfold','metad'); ?>
I am very desperate because everything was okay with version 3.2.0 and now it's gonna be a puzzle..
Of course "centerfold" is an existing page and it is not a private one.
My website made with GetSimple CMS is

Arte & Società
www.artesocieta.eu

An indipendent website about Italian Contemporary Visual Arts
Reply
#6
and where is this code?

and do you have debug mode on ?
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#7
No.
In my gsconfig it is disabled
Code:
# Turn on debug mode
#define('GSDEBUG', TRUE);
and if I turn it on, it gives me the same error message:
Code:
Warning: array_key_exists() [(function.array-key-exists)]:
The second argument should be either an array or an object in
D:\Inetpub\webs\my_site\admin\inc\caching_functions.php on line 52
My website made with GetSimple CMS is

Arte & Società
www.artesocieta.eu

An indipendent website about Italian Contemporary Visual Arts
Reply
#8
What if you add
Code:
define('GSSUPPRESSERRORS', true);
Reply
#9
Nothing to do, Carlos.
Always the same song :-(
My website made with GetSimple CMS is

Arte & Società
www.artesocieta.eu

An indipendent website about Italian Contemporary Visual Arts
Reply
#10
Shawn asked you where's your code. Template, component, plugin...?
Reply
#11
Oh right! They are directly in my template.
Only with the "content" it doesn't give me problems!
My website made with GetSimple CMS is

Arte & Società
www.artesocieta.eu

An indipendent website about Italian Contemporary Visual Arts
Reply
#12
I need to know exactly where the code is in your template. Between what functions etc, get header called first ?
etc.

I need to know with debug mode on ALL notices and warnings. Is there a notice before that warning?

And are you absolutely sure that that slug exists that you are calling for ?
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#13
For now, here is the core of the code...

PHP Code:
<div id="content">
<
div class="content_item">

<
div class='news'>Last News</div>
<?
php $page='centerfold'$data='pubDate'?>

<h1><?php getPageField($page,'title'); ?></h1>
<h2><?php getPageField($page,'metad'); ?></h2>
<?php getPageField($page,'content'); ?>

<?php include('boxes.inc.php'); ?>

<?php if (isset($_GET['post']) || "" ) { echo "<p class='copyright'>&copy; All rights reserved.</p>"; } ?>

</div><!--close content_item-->
</div><!--close content--> 
My website made with GetSimple CMS is

Arte & Società
www.artesocieta.eu

An indipendent website about Italian Contemporary Visual Arts
Reply
#14
I have tried using getPageField with non-existing slugs and the error I get (a notice) is different.
After experimenting a bit, I got D.O.'s error by inserting this in the sidebar:

Code:
<?php
global $pagesArray;
$pagesArray = NULL;
getPageField('page','title');
?>

It's like $pagesArray isn't being populated or something in D.O.'s site.
Reply
#15
I get the same error he gets with debugging on for non existing slug.

Notice: Undefined index: centerfold in /hsphere/local/home/salverso/dev.tablatronix.com/getsimple/develop/admin/inc/caching_functions.php on line 52

Warning: array_key_exists(): The second argument should be either an array or an object in /hsphere/local/home/salverso/dev.tablatronix.com/getsimple/develop/admin/inc/caching_functions.php on line 52

Like I said without knowing where this code is, cannot really determine if pages array is populated or not, cannot eliminate that either. I have yet to see where this code is located. WHAT FILE ?
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#16
I think I found it.
D.O., could it be you upgraded by uploading only the admin folder, and did not upload the root index.php file?
Reply
#17
Yes Carlos I copy the admin folder of the new gs version via FTP.

what index file? In the admin folder?


(2013-10-03, 01:43:03)Carlos Wrote: I think I found it.
D.O., could it be you upgraded by uploading only the admin folder, and did not upload the root index.php file?
My website made with GetSimple CMS is

Arte & Società
www.artesocieta.eu

An indipendent website about Italian Contemporary Visual Arts
Reply
#18
No, the one in the root, outside admin.
Upgrading is uploading:
index.php
admin/*
Reply
#19
A moment, I am gonna test it.
My website made with GetSimple CMS is

Arte & Società
www.artesocieta.eu

An indipendent website about Italian Contemporary Visual Arts
Reply
#20
You rock Carlos, it was my fault. Thanks to you and Shawn. Problem fixed.
My website made with GetSimple CMS is

Arte & Società
www.artesocieta.eu

An indipendent website about Italian Contemporary Visual Arts
Reply
#21
The entire zip needs to be extracted over your site for upgrades.

ughh, this keeps popping up.
Perhaps we should checksum this file or version it ?

Maybe even get rid of it, or make it so it includes and never ever changes.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#22
Hi Shawn,
As I said I copied only the admin folder without index.php because I didn't want to overwrite other important folders of my site.
Most probably, Carlos figured out my wrong "steps".
About your idea, I like it: index.php should includes another file in the admin folder, just to avoid problems like this.
The Problem is fixed.
Thanks for your help!
My website made with GetSimple CMS is

Arte & Società
www.artesocieta.eu

An indipendent website about Italian Contemporary Visual Arts
Reply
#23
Yeah I know, this is in the forums like 3 times, same problem.

I do not even know if we have upgrade instructions in our readme or distro for that matter. Something we probably need to focus on before any more code changes.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#24
Well the wiki clearly says
http://get-simple.info/wiki/installation:upgrade

"If you don't want to overwrite everything because for instance you have customised or edited your old files or themes then the minimum you need to upload is the folder /admin/ and the file index.php ."

For now, I will just add that verbatim to the readme as well and a link to it, since the readme only has install instructions.

Then start thinking about adding index to health check somehow, or removing code from it.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#25
The fact that everything was working fine confused me, so I didn't realize that it could depend from the index.php file
:-D
My website made with GetSimple CMS is

Arte & Società
www.artesocieta.eu

An indipendent website about Italian Contemporary Visual Arts
Reply




Users browsing this thread: 1 Guest(s)