Dirty Butter Posted November 22, 2014 Author Share Posted November 22, 2014 I did re-enter them, and so far they have remained. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted December 5, 2014 Author Share Posted December 5, 2014 The new MEtafix Search Engine tab info is empty again. I recently cleared not only cache, but cleared SQL cache and language cache - could that be the cause? I just tried clearing the SQL and language cache, with no effect on the metadata I had added, so it's more complicated than a simple clear. Quote Link to comment Share on other sites More sharing options...
bsmither Posted December 5, 2014 Share Posted December 5, 2014 In post #17 above, I wrote: In the file /classes/config.class.php, we need to fix (in my opinion, this) a bug. In the __construct() and _fetchConfig() functions: Find: $array_out = $this->_json_decode($result[0]['array']); Â Add below it: foreach($array_out as $key => $val){ if(is_null($this->_json_decode($val))) {continue;} $array_out[$key] = $this->_json_decode($val); } // Github Issue #198 The problem may be that $val could already be an array. In the _json_decode() function, something other than a string will cause problems. So:In the file /classes/config.class.php, we need to fix (in my opinion, this) a bug. In the __construct() and _fetchConfig() functions: DO NOT DO THIS! foreach($array_out as $key => $val){ if(!is_string($val)) {continue;} $array_out[$key] = $this->_json_decode($val); } // Github Issue #198 DO NOT DO THIS Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted December 5, 2014 Author Share Posted December 5, 2014 Please delete Quote Link to comment Share on other sites More sharing options...
bsmither Posted December 6, 2014 Share Posted December 6, 2014 Wow! I am so, so, so, so sorry you lost your settings. Mea Culpa. I sincerely hope you have a recent backup of the CubeCart_config table. From that, you can restore the very long string in the `array` column for the 'config' row. Quote Link to comment Share on other sites More sharing options...
bsmither Posted December 6, 2014 Share Posted December 6, 2014 Assuming you have your Store Settings back, try this in the __construct() and _fetchConfig() functions:// NEW foreach($array_out as $key => $val){ // Github Issue #198 Â if(!is_string($val)){ Â Â Â continue; Â } Â $array_out_tmp = $this->_json_decode($val); Â $array_out[$key] = !empty($array_out_tmp) ? $array_out_tmp : $val; } // NEW Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted December 6, 2014 Author Share Posted December 6, 2014 Well, I DO make backups of the whole database - but I couldn't figure out how to pull out just that part, and I had added products since that backup. SO I put it all back manually. But when I finished I made a copy in cpanel of the whole database, so I'll have a backup I know how to use if that happens again (hopefully never). If you could explain how to extract what I need from my old .sql.gz backup I'd like to learn how to do that, plus I could be sure I put everything back right. Â At this time I am NOT using this METAFIX. Oops - didn't see your post above. Will try and report. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted December 11, 2014 Author Share Posted December 11, 2014 The METAFIX %X and %Y data in the Categories Search Engines tab is blank again. I still haven't been able to spot what I'm doing that empties the information I put there. Quote Link to comment Share on other sites More sharing options...
bsmither Posted December 11, 2014 Share Posted December 11, 2014 Hmmm... Â Give me a few to figure it out. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted December 13, 2014 Author Share Posted December 13, 2014 Empty again this morning. Maybe these unique lines from the error log will give you some clues: Â Â [12-Dec-2014 00:25:43 UTC] PHP Warning:Â Invalid Security Token in /home3/butter01/public_html/plushcatalog/classes/sanitize.class.php on line 124 [12-Dec-2014 17:19:49 America/Chicago] PHP Warning:Â array_merge() [<a href='http://docs.php.net/manual/en/function.array-merge.php'>function.array-merge.php</a>]: Argument #1 is not an array in /home3/butter01/public_html/plushcatalog/classes/cubecart.class.php on line 867 [12-Dec-2014 18:11:13 America/Chicago] PHP Notice:Â GD::gdLoadFile - Unknown file type: /home3/butter01/public_html/plushcatalog/images/source/index.php in /home3/butter01/public_html/plushcatalog/classes/gd.class.php on line 75 [13-Dec-2014 01:24:42 UTC] PHP Warning:Â Security Warning: Illegal array key "$Path" was detected and was removed. in /home3/butter01/public_html/plushcatalog/classes/sanitize.class.php on line 89 [13-Dec-2014 01:24:42 UTC] PHP Warning:Â Security Warning: Illegal array key "$Domain" was detected and was removed. in /home3/butter01/public_html/plushcatalog/classes/sanitize.class.php on line 89 [13-Dec-2014 01:24:42 UTC] PHP Warning:Â Security Warning: Illegal array key "$Path" was detected and was removed. in /home3/butter01/public_html/plushcatalog/classes/sanitize.class.php on line 89 [13-Dec-2014 01:24:42 UTC] PHP Warning:Â Security Warning: Illegal array key "$Domain" was detected and was removed. in /home3/butter01/public_html/plushcatalog/classes/sanitize.class.php on line 89 [12-Dec-2014 23:41:08 America/Chicago] PHP Warning:Â array_merge() [<a href='http://docs.php.net/manual/en/function.array-merge.php'>function.array-merge.php</a>]: Argument #1 is not an array in /home3/butter01/public_html/plushcatalog/classes/cubecart.class.php on line 867 [12-Dec-2014 23:41:32 America/Chicago] PHP Fatal error:Â Call to a member function get() on a non-object in /home3/butter01/public_html/plushcatalog/classes/seo.class.php on line 201 [12-Dec-2014 23:45:14 America/Chicago] PHP Fatal error:Â Call to a member function get() on a non-object in /home3/butter01/public_html/plushcatalog/classes/seo.class.php on line 201 [13-Dec-2014 12:11:19 UTC] PHP Fatal error:Â Call to a member function assign() on a non-object in /home3/butter01/public_html/plushcatalog/classes/language.class.php on line 106 Â Quote Link to comment Share on other sites More sharing options...
bsmither Posted December 13, 2014 Share Posted December 13, 2014 [12-Dec-2014 00:25:43 UTC] is what happens when the browser's back button is pressed and a set of data is POSTed after a prior POSTing, or having more than one window open and attempting to POST from both. Â [12-Dec-2014 17:19:49 America/Chicago], [12-Dec-2014 23:41:08 America/Chicago] appears to be a statement new to CC5214 and involves the customer not having a billing address at a particular point in the checkout process. This is line 836 in a stock CC5214 cubecart.class.php file. Have you made any edits to this file? Â [12-Dec-2014 18:11:13 America/Chicago] is because you have a file that is not a recognized image type in the /images/source/ directory. Â [13-Dec-2014 01:24:42 UTC] are interesting. It could either be a badly configured scanner/robot, or a true bug in the CubeCart code. If you look at the web access log for this time you should be able to determine what the URL was that had these bad keys. Â [12-Dec-2014 23:41:32 America/Chicago], [12-Dec-2014 23:45:14 America/Chicago] may be caused by PHP shutting down after a Fatal Error, and during shutdown, the SEO->enabled() function called while the Config class has gone missing. This line 196 in a stock CC5213/5214 file. Have you edited the seo.class.php file? Â [13-Dec-2014 12:11:19 UTC] is the same as the prior errors except the Smarty class has gone missing. Â I think none of these errors contain a clue to why the extra meta-data is getting lost. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted December 13, 2014 Author Share Posted December 13, 2014 The [13-Dec-2014 01:24:42 UTC] ones might have to do with a developer's edits, if you don't think it has anything to do with this metadata issue. It's not a mod, but modified code. I'm not positive that's when I started seeing these error messages, but I think his edits caused it. Â I've looked over and over for the image file type that's causing the error, but no luck. Didn't expect that to be the issue here. Â I DO have Checkout edited so they don't see any temporary s/h info, so the s/h shows AFTER they have input the actual delivery address. Â I DO have mod edits in seo.class.php, so my line numbers are different than stock. /** * SEO enabled? * * @return bool */ public function enabled() { return $GLOBALS['config']->get('config', 'seo'); } Quote Link to comment Share on other sites More sharing options...
bsmither Posted December 13, 2014 Share Posted December 13, 2014 On second thought, while the Config class has gone missing, is a good indicator of a possibility. But this would only happen if the extra meta-data were added at the same time PHP crashed - so that it wouldn't get saved. But once saved it's always saved, unless something comes along and messes up the retrieval. Â I may ask that you add some diagnostic code to the /classes/config.class.php file for the fix in post #31. Â I'm also wondering if there is some code that fetches the config array and does not use the Config->__construct() or Config->_fetchConfig() functions. I'll scan for that. Quote Link to comment Share on other sites More sharing options...
bsmither Posted December 13, 2014 Share Posted December 13, 2014 Well, there is other code that fetches the config array, but those instances are in /setup/. I think that would not cause any issue. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted December 13, 2014 Author Share Posted December 13, 2014 Â I may ask that you add some diagnostic code to the /classes/config.class.php file for the fix in post #31. Â Just tell me what to do and I'll try it. Â Â [13-Dec-2014 01:24:42 UTC] are interesting. It could either be a badly configured scanner/robot, or a true bug in the CubeCart code. If you look at the web access log for this time you should be able to determine what the URL was that had these bad keys. Â I don't know how to see the web access log, other than what I see in Users online. I can see in Webots in Users Online in Admin that TheFind bot was accessing the store at 01:24 Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted December 13, 2014 Author Share Posted December 13, 2014 Just looked, and this same code is also in the estates store error log, which does NOT have the testimonial mod edits I thought might be causing this: Â [13-Dec-2014 12:20:46 UTC] PHP Warning:Â Security Warning: Illegal array key "$Path" was detected and was removed. in /home3/butter01/public_html/dirtybutterestates.com/classes/sanitize.class.php on line 88 [13-Dec-2014 12:20:46 UTC] PHP Warning:Â Security Warning: Illegal array key "$Domain" was detected and was removed. in /home3/butter01/public_html/dirtybutterestates.com/classes/sanitize.class.php on line 88 [13-Dec-2014 12:20:46 UTC] PHP Warning:Â Security Warning: Illegal array key "$Path" was detected and was removed. in /home3/butter01/public_html/dirtybutterestates.com/classes/sanitize.class.php on line 88 [13-Dec-2014 12:20:46 UTC] PHP Warning:Â Security Warning: Illegal array key "$Domain" was detected and was removed. in /home3/butter01/public_html/dirtybutterestates.com/classes/sanitize.class.php on line 88 [13-Dec-2014 09:54:01 America/Chicago] PHP Warning:Â array_merge() [<a href='http://docs.php.net/manual/en/function.array-merge.php'>function.array-merge.php</a>]: Argument #1 is not an array in /home3/butter01/public_html/dirtybutterestates.com/classes/cubecart.class.php on line 867 [13-Dec-2014 09:54:29 America/Chicago] PHP Fatal error:Â Call to a member function get() on a non-object in /home3/butter01/public_html/dirtybutterestates.com/classes/seo.class.php on line 201 Â Quote Link to comment Share on other sites More sharing options...
bsmither Posted December 13, 2014 Share Posted December 13, 2014 "I don't know how to see the web access log." Â In your cPanel. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted December 13, 2014 Author Share Posted December 13, 2014 I downloaded the raw access log from cpanel, but it doesn't go back that far, and I didn't have it marked to Archive it. Â The estates store DOES have the METAFIX Categories tab in use, as well as your Search, Sale Items, and Registration meta settings, but the Categories Metafix is NOT disappearing on that store. Quote Link to comment Share on other sites More sharing options...
bsmither Posted December 13, 2014 Share Posted December 13, 2014 So, can we make a basic assumption the only differences between the two stores is the skin and the testimonial mod? Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted December 13, 2014 Author Share Posted December 13, 2014 I'll have to double check that I've kept up with any edits you and others have suggested, plus maybe a mod I didn't buy for the estates store. That store is not our main priority and gets few sales, so it's possible there are other differences. I'll download and run a Compare of the two stores and get back to you. Thanks for bearing with me. Your help is always very appreciated!! Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted December 14, 2014 Author Share Posted December 14, 2014 I have found what I did that erased the metafix data - I made a change to Store Settings. But I must have done something wrong with the debug tracer code you sent me, as nothing shows up there when the data disappeared. Â These actions did NOT affect the Categories metafix data - adding or removing a category; moving an item from one category to another; creating a new testimonial or deleting it; creating or editing a product listing; changing the Search, Sales Items, or Registration metadata. Quote Link to comment Share on other sites More sharing options...
bsmither Posted December 15, 2014 Share Posted December 15, 2014 I think I found it. I will have to check to see if, when POSTing from the Store Settings page, is all that data being used as is, or is it being merged into the existing config array. Â I had hoped it was being merged which allows for extra settings to be added to the general config array from POSTings not on the Store Settings page. Â But if by POSTing from the Store Settings page, the existing general config array is dumped whole cloth in favor of the POST array, then that could explain it. Â I'll be back shortly. Quote Link to comment Share on other sites More sharing options...
bsmither Posted December 15, 2014 Share Posted December 15, 2014 Maybe an earlier version of CC5 did attempt to merge new config data with existing config data. I see:[code} $config_old   = $GLOBALS['config']->get('config'); in the settings.index.inc.php file, but it's not used anywhere.  The complete config array is replaced by what's POSTed.  So, we either make a separate config array for the extra meta-data for PAGE=ALL situations, or we move those fields from admin Categories to Store Settings.  Because these fields are more of a general store setting than specifically oriented towards categories (and that only a category list (search, saleitems) will have pagination, which means we don't have to make this more generalized to fit products or documents), I am leaning towards moving the fields to Store Settings. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted December 15, 2014 Author Share Posted December 15, 2014 Where to do it is entirely up to you! I'm sorry this has been such a time consuming exercise, but it is truly helpful. I've rather quickly been able to tell when the metafix data was emptied, because Google would start showing warnings about duplicate data again. Quote Link to comment Share on other sites More sharing options...
bsmither Posted December 15, 2014 Share Posted December 15, 2014 These instructions are relative to post #17. Â From the admin template categories.index.php, remove: {* NEW *} Â Â Â <div id="addl_seo" class="tab_content"> Â Â Â Â Â Â Â <h3>Additional page=all {$LANG.settings.title_seo}</h3> Â Â Â Â Â Â Â <fieldset> Â Â Â Â Â Â Â Â Â Â Â <div><label for="seo_meta_title_all">Additional page=all Meta Title</label><span><input type="text" name="seo[meta_title_all]" id="seo_meta_title_all" class="textbox" value="{$seo_meta_title_all}" /></span></div> Â Â Â Â Â Â Â Â Â Â Â {* <div><label for="seo_path_all">Additional page=all SEO Path</label><span><input type="text" name="seo[path_all]" id="seo_path_all" class="textbox" value="{$seo_path_all}" /></span></div> *} Â Â Â Â Â Â Â Â Â Â Â <div><label for="seo_meta_description_all">Additional page=all Meta Description<br /><br />%X for existing, %Y for Meta Title<br /> Â Â Â Â Â Â Â Â Â Â Â Example:<br /> Â Â Â Â Â Â Â Â Â Â Â All Meta Title-- <tt>All Our %X</tt><br /> Â Â Â Â Â Â Â Â Â Â Â {* All SEO Path-- <tt>all-our-%X</tt><br /> *} Â Â Â Â Â Â Â Â Â Â Â All Meta Desc-- <tt>%X See all our %Y on one page.</tt></label><span><textarea name="seo[meta_description_all]" id="seo_meta_description_all" class="textbox">{$seo_meta_description_all}</textarea></span></div> Â Â Â Â Â Â Â </fieldset> Â </div> {* NEW *} In the admin template settings.index.php, add the following to between these two statements near lines 181-182: Â </fieldset> Â <fieldset><legend>{$LANG.settings.title_seo_meta_behaviour}</legend> resulting in (Note, the new code looks similar to what was removed above, but there are differences): Â </fieldset> {* NEW *} Â <fieldset><legend>Additional page=all {$LANG.settings.title_seo_meta_data}</legend> Â Â Â <div><label for="seo_meta_title_all">Additional page=all Meta Title</label><span><input type="text" name="config[catsAddlSEO][meta_title_all]" id="seo_meta_title_all" class="textbox" value="{$CONFIG.catsAddlSEO.meta_title_all}" /></span></div> Â Â Â {* <div><label for="seo_path_all">Additional page=all SEO Path</label><span><input type="text" name="config[catsAddlSEO][path_all]" id="seo_path_all" class="textbox" value="{$CONFIG.catsAddlSEO.path_all}" /></span></div> *} Â Â Â <div><label for="seo_meta_description_all">Additional page=all Meta Description<br /><br />%X for existing, %Y for Meta Title<br /> Â Â Â Example:<br /> Â Â Â All Meta Title-- <tt>All Our %X</tt><br /> Â Â Â {* All SEO Path-- <tt>all-our-%X</tt><br /> *} Â Â Â All Meta Desc-- <tt>%X See all our %Y on one page.</tt></label><span><textarea name="config[catsAddlSEO][meta_description_all]" id="seo_meta_description_all" class="textbox">{$CONFIG.catsAddlSEO.meta_description_all}</textarea></span></div> Â </fieldset> {* NEW *} Â <fieldset><legend>{$LANG.settings.title_seo_meta_behaviour}</legend> In /admin/source/categories.index.inc.php, remove what was added in post #17 -- but only what was added relative to this one specific file! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.