Project

General

Profile

Bug #89182

Updated by Sybille Peters about 5 years ago

Some checks should only be performed if content is relevant.  

 For example: 

 tt_content.bodytext : depends on ctype (e.g. is usually not relevant for plugins) 
 pages.url : depends on doktype 


 The problem is currently, if page or content element type is change, the content is not removed from the fields which are now no longer relevant, so in older sites where this had been changed, you may get a lot of "broken links" for content that is not rendered in FE and is irrelevant. 

 h2 Reproduce 

 # Create a content element, e.g. "text & media" 
 # Add a broken link If it were possible to the content (tt_content.bodytext) 
 # Now change the content type, e.g. to plugin  
 # We recheck for broken links for that page 
 # We look at linkvalidator report 

 h2. Actual result 

 The broken link will be displayed 

 h2. Expected result 

 The broken link in the element "plugin" should not be displayed, because tt_content.bodytext is not relevant if content type is plugin 


 h2. Possible solution 

 Possible ideas: 

 * *automatic* (preferred): Handle this in a restriction_builder per table.field. We can get the information, which fields are editable for a content element via TCA: 'interface' => 'showRecordFieldList'. If the editor can edit the field (permissions) is already checked in #84214 
 * configure: Add (optionally) add restrictions to the query via TSconfig 


 h3. Automatic (TCA) 

 Examples: tt_content 

 * Get content type from tt_content.ctype 
 * bootstrap_package accordion_item has 'interface' => 'showRecordFieldsList': .. bodytext so TSconfig, this would solve tI have seen this problemhe problem.  

 In order to be backwards compatible, we should check that.  


 Examples: pages could do something like: 

 * canonical_link 
 * url (depends on doktype) 

 * tt_content.bodytext: depends on ctype (should not be 'header', '  


 h3. Configure TSconfig 

 <pre> 
 mod.linkvalidator { 

 # this is already existing TSconfig which defineds the table / field combinations 
 searchFields = { 

   pages = media,url 
 } 

 # this could be additional restrictions for the fields 
 searchRestrictions = { 

   pages.url { 
     ... 
   } 
 } 
 </pre> 

Back