// If no name given, create a unique name based on the title
if (empty($item['name'])) {
- $prefix = !empty($item['join']) ? "afjoin-{$item['join']}" : !empty($item['block']) ? 'afblock-' . str_replace('*', 'all', $item['block']) : 'afform';
+ $prefix = !empty($item['join']) ? "afjoin-{$item['join']}" : (!empty($item['block']) ? ('afblock-' . str_replace('*', 'all', $item['block'])) : 'afform');
$item['name'] = _afform_angular_module_name($prefix . '-' . \CRM_Utils_String::munge($item['title'], '-'));
$suffix = '';
while (
$isChanged = function($field) use ($item, $orig) {
return ($item[$field] ?? NULL) !== ($orig[$field] ?? NULL);
};
+
+ if ($isChanged('is_dashlet')) {
+ // FIXME: more targetted reconciliation
+ \CRM_Core_ManagedEntities::singleton()->reconcile();
+ }
+ elseif (array_key_exists('is_dashlet', (array) $orig) && $orig['is_dashlet'] && $isChanged('title')) {
+ // FIXME: more targetted reconciliation
+ \CRM_Core_ManagedEntities::singleton()->reconcile();
+ }
+
// Right now, permission-checks are completely on-demand.
if ($isChanged('server_route') /* || $isChanged('permission') */) {
\CRM_Core_Menu::store();
\CRM_Core_BAO_Navigation::resetNavigation();
}
- // FIXME if asset-caching is enabled, then flush the asset cache.
$item['module_name'] = _afform_angular_module_name($item['name'], 'camel');
$item['directive_name'] = _afform_angular_module_name($item['name'], 'dash');