core icon indicating copy to clipboard operation
core copied to clipboard

System log errors: add URL or page id

Open Anke opened this issue 9 years ago • 4 comments

On larger websites, especially when they are a few years old, getting periodic updates and redesigns, things happen like e.g. forgetting to delete or replace a CE that belongs to an uninstalled extension.

Such editor errors are listed in the system log, which is great. However it only says something like

Content element class "" (content element "grid") does not exist

Is it possible to include the URL or ID of the deficient pages in the system log? It would save webmasters a lot of searching.

Anke avatar Mar 01 '16 14:03 Anke

I've got the same problem!

kubjo avatar Mar 02 '16 07:03 kubjo

:+1:

fritzmg avatar Mar 02 '16 10:03 fritzmg

In the mean time you could exchange this line with

$link = '';
if( $objRow->ptable == 'tl_article' )
    $link = ' » <a href="contao/main.php?do=article&amp;table=tl_content&amp;id=' . $objRow->pid . '&amp;rt=' . REQUEST_TOKEN . '">go to article</a>';
static::log('Content element class "'.$strClass.'" (content element "'.$objRow->type.'") does not exist'.$link, __METHOD__, TL_ERROR);

This should insert a link to the article where the content element exists. Note that this is untested.

fritzmg avatar Mar 02 '16 10:03 fritzmg

Aforementioned script replace only works with content elements who are within articles. The script would have to be changed to work with any parent element.

The same improvement could also be done for these log entries:

A new version of record "tl_content.id=2000" has been created (parent records: tl_article.id=116, tl_page.id=124)

tl_content.id=… and tl_article.id=116 could be linked with the respective editing URLs.

fritzmg avatar Apr 04 '16 08:04 fritzmg