MOBILE-3140 Blocks: Make blocks work if displaydata not specified

If displaydata is not specified in mobile.php for a block, it
did not work due to a JavaScript error.
main
sam marshall 2019-09-04 15:18:12 +01:00
parent 3edc42ccc2
commit c3acfeacf7
1 changed files with 2 additions and 1 deletions

View File

@ -664,7 +664,8 @@ export class CoreSitePluginsHelperProvider {
const uniqueName = this.sitePluginsProvider.getHandlerUniqueName(plugin, handlerName),
blockName = (handlerSchema.moodlecomponent || plugin.component).replace('block_', ''),
prefixedTitle = this.getPrefixedString(plugin.addon, handlerSchema.displaydata.title || 'pluginname');
titleString = (handlerSchema.displaydata && handlerSchema.displaydata.title) ? handlerSchema.displaydata.title : 'pluginname',
prefixedTitle = this.getPrefixedString(plugin.addon, titleString);
this.blockDelegate.registerHandler(
new CoreSitePluginsBlockHandler(uniqueName, prefixedTitle, blockName, handlerSchema, initResult));