Jump to content

Sitemap Timestamp issue since 6.0.12


Dirty Butter

Recommended Posts

My sitemap code has been extensively edited per Bsmither various directions. Since I am getting a timestamp error since upgrading to 6.0.12, I want to change back to original code temporarily until I can find my merge error. I know there's sitemap code in seo.class.php. Is there somewhere else there is sitemap code I need to revert temporarily?

Link to comment
Share on other sites

Other than the sitemap() function in seo.class.php, the private function at _site_map_link() at the bottom of the file is used by sitemap().

The only change to the seo.class.php file is dealing with the "Shop by Category" navigation array containing absolute URLs when it really shouldn't.

I am not aware of any other place that "prepares" CubeCart for a site map. Maybe third-party?

Link to comment
Share on other sites

Uh Oh - It's not that simple. I ended up using the stock seo.class.php file just to be sure it was working properly, and it's not. I get the sitemap.xml.gz file. The timestamp for all categories and documents is correct. BUT all product listings have 1969-12-31T18:33:32-06:00 as the timestamp. This is the same thing it was doing with my own edited code.

Based on what you said about the Category and absolute value being the only thing different between 6.0.11 and 6.0.12, I reverted to my old 6.0.11 seo.class.php file, and it created a good sitemap.

So, is the problem with the new code itself, or likely to be some edit I have in place that conflicts with the new code? I've attached a copy of my 6.0.11 file.

NOTGOODseo.class.php See comment below.

 

Link to comment
Share on other sites

I double checked everything today, hoping with fresh eyes I would spot the cause - but no luck. If I use the clean 6.0.12 seo.class.php file, I get the wrong timestamp on the product url's. If I use my 6.0.11 file instead, I get a good sitemap.xml. The 6.0.12 code change is merged correctly in gui.class.php, so that's not the issue.

I just tried it with the CC demo store, and it created a sitemap with the same timestamp issue. This is a bug.

https://github.com/cubecart/v6/issues/1141

Link to comment
Share on other sites

Please post the code that is yours from the file seo.class.php, near line (for CC6012) 722. The stock CC6012 line is:

$this->_sitemap_link(array('key' => $key, 'id' => $id), (isset($record['updated']) && !empty($record['updated'])) ? (int)$record['updated'] : time(), $type);

The suggested replacement is:

$this->_sitemap_link(array('key' => $key, 'id' => $id), (isset($record['updated']) && !empty($record['updated'])) ? strtotime($record['updated']) : time(), $type);

With your edits and an explanation of what you are trying to accomplish, we can create an edit for CC6012 that should work for you incorporating your intentions.

Link to comment
Share on other sites

Just to see what would happen, I substituted your repaired code for the bad one. The only part I did not use from my edits was the part that did not use the .gz form of the sitemap.

It appears to create a sitemap.xml.gz that has the last update date for each item - not the date when the sitemap was created (today). I checked the old 6.0.11 version sitemap, and it has the current date as of that sitemap for ALL products. (I keep all products in the sitemap - sold or not, since part of our purpose is to help people find lovies, not just sell them.)

The other edits in MY seo.class.php were to increase the accuracy of the sitemap by better obeying the robots.txt file. Of course there are some mod edits, but they don't seem to have anything to do with the sitemap.xml, as far as I can tell.

Link to comment
Share on other sites

I am now using My version of seo.class.php with your REVISED line for the sitemap, and it's working properly - other than it not putting the current timestamp. It's always been current timestamp before.

I'll have to get busy opening and saving our oldest items, so the timestamp will be recent. I did find, when I sorted the Products list by last updated - there were about a dozen listings (some in stock) that had all zeros as the time! I could not get a valid sitemap.xml until I opened and then saved all of those.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...