Forum Discussion
VarunGrazittiyes the issue is when user have more than 1000+ notification then its showing widget is not displaying and site design is getting shatterd. So i want to debug this error at stage environment. For that I need to insert 1000+ notification for the user.
- bhupen10 years agoAdvisor
Please find attached file for code.
- VarunGrazitti10 years agoBossbhupen - please upload the code again, it is missing, or PM me.
- bhupen10 years agoAdvisor
<#assign pageSize = 5 />
<#assign truncateLimit = 15 />
<#assign badges = '' /> <#-- let's keep empty the badges cause we don't know if we need them -->
<#assign badges_i = '' />
<#assign notificationPageURL = community.urls.tapestryPrefix + '/notificationfeed/page' />
<#assign _notificationsCount = restadmin( '/users/id/' + user.id + '/notifications/count' ).value?number />
<#assign notifications = [] />
<#assign allowed = [ 'kudos', 'mentions', 'solutions', 'badge', 'rank' ] />
<#assign notificationsPage = 1 />
<#assign usedNotifications = [] />
<#function getNotifications>
<#assign page = notificationsPage * pageSize />
<#assign nots = restadmin( '/users/id/' + user.id + '/notifications?restapi.response_style=view&page_size=' + page ).notifications />
<#if ( nots?size > 0 )>
<#list nots.notification as notification>
<#if ( ( !usedNotifications?seq_contains( notification_index ) ) && ( allowed?seq_contains( notification.notification_type ) ) && ( notifications?size < pageSize ) )>
<#assign notifications = notifications + [notification]>
<#assign usedNotifications = usedNotifications + [notification_index]>
</#if>
</#list>
<#if ( notifications?size < pageSize && ( ( _notificationsCount - page ) > 0 ) )>
<#assign notificationsPage = notificationsPage + 1 />
<#assign go = getNotifications() />
</#if>
</#if>
<#assign nots = restadmin( '/users/id/' + user.id + '/notifications?restapi.response_style=view&page_size=' + page ).notifications />
<#return 1 />
</#function>
Related Content
- 10 years ago
- 5 months ago
- 3 years ago