System log errors: add URL or page id
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.
I've got the same problem!
:+1:
In the mean time you could exchange this line with
$link = '';
if( $objRow->ptable == 'tl_article' )
$link = ' » <a href="contao/main.php?do=article&table=tl_content&id=' . $objRow->pid . '&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.
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.