Skip to content

Commit

Permalink
#62 fix extension renderers and add some defensive code for content r…
Browse files Browse the repository at this point in the history
…endering issues
  • Loading branch information
DominicWatson committed Jul 12, 2022
1 parent 466963f commit b4a2834
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 2 additions & 0 deletions handlers/renderers/content/DataApiPageLink.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ component {
if ( pageId.len() ) {
return event.buildLink( page=pageId );
}

return "";
}
}
2 changes: 1 addition & 1 deletion handlers/renderers/content/DataApiPageLinkArray.cfc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
component {

private string function default( event, rc, prc, args={} ){
private array function default( event, rc, prc, args={} ){
var pages = ListToArray( args.data ?: "" );

for( var i=1; i<=pages.len(); i++ ) {
Expand Down
14 changes: 10 additions & 4 deletions services/DataApiService.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -325,13 +325,19 @@ component {
}

if ( $getContentRendererService().rendererExists( renderer, "dataapi" ) ) {
var renderedContent = $renderContent( renderer, arguments.value, "dataapi", arguments.fieldSettings );
if ( Len( renderedContent ?: "" ) ) {
return renderedContent;
try {
var renderedContent = $renderContent( renderer, arguments.value, "dataapi", arguments.fieldSettings );
if ( Len( renderedContent ?: "" ) ) {
return renderedContent;
}
} catch( any e ) {
$raiseError( e );
}

}

if ( Len( arguments.value ?: "" ) ) {
return arguments.value;
}
return $isFeatureEnabled( "dataApiUseNullForStrings" ) ? NullValue() : "";
}

Expand Down

0 comments on commit b4a2834

Please sign in to comment.