Posts: 321
Threads: 15
Joined: Feb 2012
2013-05-13, 22:39:27
(This post was last modified: 2013-05-13, 22:42:58 by D.O..)
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: 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 114
Any help?
My website made with GetSimple CMS is
Arte & Società
www.artesocieta.eu
An indipendent website about Italian Contemporary Visual Arts
Posts: 6,266
Threads: 181
Joined: Sep 2011
Where in your template is this, so i can reproduce.
Also does namepage exist ? Is that the exact code ? and only error ?
Posts: 321
Threads: 15
Joined: Feb 2012
2013-10-02, 02:29:14
(This post was last modified: 2013-10-02, 02:32:36 by D.O..)
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: 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
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
Posts: 6,266
Threads: 181
Joined: Sep 2011
If I had to guess $pagina is not set to anything.
Posts: 321
Threads: 15
Joined: Feb 2012
2013-10-02, 04:30:35
(This post was last modified: 2013-10-02, 04:31:44 by D.O..)
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
Posts: 6,266
Threads: 181
Joined: Sep 2011
and where is this code?
and do you have debug mode on ?
Posts: 321
Threads: 15
Joined: Feb 2012
2013-10-02, 05:21:34
(This post was last modified: 2013-10-02, 05:22:10 by D.O..)
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
Posts: 3,491
Threads: 106
Joined: Mar 2010
What if you add
Code: define('GSSUPPRESSERRORS', true);
Posts: 321
Threads: 15
Joined: Feb 2012
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
Posts: 3,491
Threads: 106
Joined: Mar 2010
Shawn asked you where's your code. Template, component, plugin...?
Posts: 321
Threads: 15
Joined: Feb 2012
2013-10-02, 05:53:15
(This post was last modified: 2013-10-02, 05:55:08 by D.O..)
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
Posts: 6,266
Threads: 181
Joined: Sep 2011
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 ?
Posts: 321
Threads: 15
Joined: Feb 2012
2013-10-02, 15:45:57
(This post was last modified: 2013-10-02, 15:48:11 by D.O..)
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'>© 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
Posts: 3,491
Threads: 106
Joined: Mar 2010
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.
Posts: 6,266
Threads: 181
Joined: Sep 2011
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 ?
Posts: 3,491
Threads: 106
Joined: Mar 2010
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?
Posts: 321
Threads: 15
Joined: Feb 2012
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
Posts: 3,491
Threads: 106
Joined: Mar 2010
2013-10-03, 03:16:01
(This post was last modified: 2013-10-03, 03:16:35 by Carlos.)
No, the one in the root, outside admin.
Upgrading is uploading:
index.php
admin/*
Posts: 321
Threads: 15
Joined: Feb 2012
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
Posts: 321
Threads: 15
Joined: Feb 2012
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
Posts: 6,266
Threads: 181
Joined: Sep 2011
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.
Posts: 321
Threads: 15
Joined: Feb 2012
2013-10-03, 15:55:47
(This post was last modified: 2013-10-03, 15:56:54 by D.O..)
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
Posts: 6,266
Threads: 181
Joined: Sep 2011
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.
Posts: 6,266
Threads: 181
Joined: Sep 2011
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.
Posts: 321
Threads: 15
Joined: Feb 2012
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
|