Rebuild content


(Gereon Goldbach) #1

Is it possible to restrict the funtion “rebuild content” to a specific template? Why I am asking: I have a travel site, where I create automatically pages from my own api in modx (>2000 pages per languages) with content and I would like to use ContentBlocks only for specific pages like blog pages.

Many Thanks for any help.

Gereon


(Mark Hamstra) #2

At the moment, no, you can’t filter the rebuild content. It will however skip over the resources that don’t use ContentBlocks as it comes across them, so it shouldn’t be trying to process thousands of resources in your case.


(Mark Hamstra) #3

I’ve applied a small fix in 1.8.3 that makes sure it skips over resources that don’t use ContentBlocks without an extra delay. Should make it faster in your case :slight_smile:


(Gereon Goldbach) #4

Perfect. Many thanks for your fast support.


(Gereon Goldbach) #5

I updated my page to 2.7 and now get the following error in the modal window when I rebuild the content. Do you have any idea why the bug now appears? I already deleted the cache completely. At the moment many errors (deprecated etc.) are displayed in the logfile so that I can not see exactly where the problem lies.

Error HY000 executing statement: Array ( [0] => HY000 [1] => 2014 [2] => Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute. )
Error HY000 executing statement: INSERT INTO modx_session (id, access, data) VALUES (‘r3vbsugl8aqm73e5ukurnuocnm’, 1547416114, ‘modx.user.0.resourceGroups|a:1:{s:3:“mgr”;a:0:{}}modx.user.0.attributes|a:2:{s:3:“web”;a:5:{s:16:“modAccessContext”;a:1:{s:3:“web”;a:1:{i:0;a:3:{s:9:“principal”;i:0;s:9:“authority”;s:1:“0”;s:6:“policy”;a:1:{s:4:“load”;b:1;}}}}s:22:“modAccessResourceGroup”;a:0:{}s:17:“modAccessCategory”;a:0:{}s:28:“sources.modAccessMediaSource”;a:0:{}s:18:“modAccessNamespace”;a:0:{}}s:3:“mgr”;a:5:{s:16:“modAccessContext”;a:1:{s:3:“web”;a:1:{i:0;a:3:{s:9:“principal”;i:0;s:9:“authority”;s:1:“0”;s:6:“policy”;a:1:{s:4:“load”;b:1;}}}}s:22:“modAccessResourceGroup”;a:0:{}s:17:“modAccessCategory”;a:0:{}s:28:“sources.modAccessMediaSource”;a:0:{}s:18:“modAccessNamespace”;a:0:{}}}modx.user.contextTokens|a:1:{s:3:“mgr”;i:1;}modx.mgr.user.token|s:52:“modx5c1f783ed737f6.09865629_15c3ba13bcf0a77.00518089”;modx.mgr.session.cookie.lifetime|i:0;modx.mgr.user.config|a:0:{}modx.user.1.userGroupNames|a:1:{i:0;s:13:“Administrator”;}’) Array ( [0] => HY000 [1] => 2014 [2] => Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute. )
PHP warning: Unknown: Failed to write session data using user defined save handler. (session.save_path: /var/lib/php/session)


(Mark Hamstra) #6

Could use the error log analyzer in SiteDash to get a better idea of what’s going on in your error log. That error suggests some issues retrieving data from/writing data to the database because of unfinished queries. Those can be tricky to track down, looking at the PROCESSLIST in MySQL can help.


(Gereon Goldbach) #7

I do not know why yet, but I’ve rebuilt all alias and saved the resource again with a snippet. After clear the whole cache, now have only one and not many session errors with ContentBlock. I have a seperate mariaDB server and the PROCESSLIST for this modx db is empty. Clear the cache with modx works without errors.