Coded something up in Couch in an interesting way? Have a snippet or shortcode to share? Post it here for the community to benefit.
13 posts Page 2 of 2
Christoph, I had a look at the code and found that it does not take into account the case where Couch tables are configured to use a 'prefix' (as seems to be in your case).

To rectify the issue, please find the following line (line 85 currently) -
Code: Select all
<cms:query sql="SELECT p.modification_date FROM couch_pages p WHERE p.template_id = '<cms:show k_template_id/>'">

- and modify it to this
Code: Select all
<cms:query sql="SELECT p.modification_date FROM <cms:php>echo K_TBL_PAGES;</cms:php> p WHERE p.template_id = '<cms:show k_template_id/>'">

Hope this helps.
Thank you Kamran, that solved the problem! Have a nice day
cl wrote: I love this addon and used it in all my pages but lately i get an error on my test and live site when looking in the sitemap

"Could not successfully run query: Table 'databasenamehere.couch_pages' doesn't exist"

Any idea what i did wrong? php version is 7.1

Thank you very much!


I encountered the same error, the fix is simple

you will need to correct this code in the sitemap.php file

Code: Select all
<cms:query sql="SELECT p.modification_date FROM couch_pages p WHERE p.template_id = '<cms:show k_template_id/>'">
<cms:date "<cms:if modification_date='0000-00-00 00:00:00'><cms:show k_page_date /><cms:else /><cms:show modification_date /></cms:if>" format='Y-m-d' />
</cms:query>


were is it says FROM couch_pages p WHERE p.template_id correct it to FROM couchcouch_pages p WHERE p.template_id

your final code should be as follows

Code: Select all
<cms:query sql="SELECT p.modification_date FROM couchcouch_pages p WHERE p.template_id = '<cms:show k_template_id/>'">
<cms:date "<cms:if modification_date='0000-00-00 00:00:00'><cms:show k_page_date /><cms:else /><cms:show modification_date /></cms:if>" format='Y-m-d' />
</cms:query>


It looks like there is something that changed in the couch database system

That fixed the issue for me :)
13 posts Page 2 of 2

Who is online

In total there are 4 users online :: 0 registered, 0 hidden and 4 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 4 guests