donpetru Posted May 28, 2019 Posted May 28, 2019 I don't know if there is a good section for this topic, but the IPS community does not have a dedicated forum for technical support or soft-forum reporting issues. I have not seen such a section that would treat such aspects clearly! I have the latest IPS4 installed and I generated a block with the latest articles. This block has been integrated into the index page but the column that lists the latest comments added to the articles show my admin name to all articles, although I have not made the last comments !!! For example, there are articles where I have not added any comments but the block displays the last comment made by me on all the articles listed. Be a template error !!! I don't think, because the default IPS4 template is the same thing! So, the block code does not correctly identify the user who made the last comment on the last articles listed by the block !!! Is there any solution to this problem? Please. This is the block code: {{if !empty( $records ) }} <h3 class='ipsWidget_title ipsType_reset'>{$title}</h3> {{if $orientation == 'vertical'}} <div class='ipsPad_half ipsWidget_inner'> <ul class='ipsDataList ipsDataList_reducedSpacing ipsContained_container'> {{foreach $records as $record}} <li class='ipsDataItem'> <div class='ipsDataItem_icon ipsPos_top'> {template="userPhoto" group="global" app="core" params="$record->author(), 'tiny'"} </div> <div class='ipsDataItem_main cWidgetComments'> <div class="ipsCommentCount ipsPos_right {{if ( $record->record_comments ) === 0}}ipsFaded{{endif}}" data-ipsTooltip title='{lang="num_replies" pluralize="$record->record_comments"}'>{expression="$record->record_comments"}</div> <div class='ipsType_break ipsContained'> <a href="{$record->url()->setQueryString( 'do', 'getLastComment' )}" title='{lang="view_this_cmsrecord" sprintf="\IPS\Member::loggedIn()->language()->addToStack( 'content_db_lang_sl_' . $record::$customDatabaseId, FALSE ), $record->_title"}' class='ipsDataItem_title'>{$record->_title}</a> </div> <p class='ipsType_reset ipsType_medium ipsType_blendLinks'> <span>PRINT {lang="byline_nodate" htmlsprintf="$record->author()->link()"}</span><br> <span class="ipsType_light">{datetime="$record->mapped('date')"}</span> </p> </div> </li> {{endforeach}} </ul> </div> {{else}} <div class='ipsWidget_inner'> <ul class='ipsDataList ipsContained_container'> {template="recordRow" group="listing" location="database" app="cms" themeClass="IPS\cms\Theme" params="null, null, $records"} </ul> </div> {{endif}} {{endif}}
HeadStand Posted May 28, 2019 Posted May 28, 2019 The default IPS template here is not meant for comments, it's meant for records. Since you're using that same template, it's not presenting the information in the way that you think it is. 1. You are using the record author instead of the last commenter. <span>PRINT {lang="byline_nodate" htmlsprintf="$record->author()->link()"}</span><br> $record->author() refers to the member who wrote the RECORD, not the member who wrote the comment. 2. For horizontal orientation, you are straight-up calling the default IPS template, which will also use the record author. {template="recordRow" group="listing" location="database" app="cms" themeClass="IPS\cms\Theme" params="null, null, $records"} I think what you need is to set up a feed of comments, not a feed of articles. That should be closer to what you're looking for.
donpetru Posted May 28, 2019 Author Posted May 28, 2019 Thanks for the answer but I attached an image to see the problem I wanted to highlight. 2 hours ago, HeadStand said: You are using the record author instead of the last commenter. <span>PRINT {lang="byline_nodate" htmlsprintf="$record->author()->link()"}</span><br> $record->author() refers to the member who wrote the RECORD, not the member who wrote the comment. The template default block is generated by the IPS platform. So, the code I posted above is not generated or created by me. I also understand your point of view, but I do not have to create a comment feed, I would like to make this feed feasible with the latest articles.
bfarber Posted May 29, 2019 Posted May 29, 2019 Does the last commenter show correctly when viewing the listing within the database? On the surface my hunch is that you disabled "bumping" the record when a new comment is made (in the database settings), but I can't be certain without viewing the site and the configuration.
donpetru Posted June 4, 2019 Author Posted June 4, 2019 Sorry for delay. bfarber, thanks for the answer. The last commenter is show correctly when if I view the record. Now I found that the error only appears on the old registered items (articles) that are listed by the block. If I post a new article and I post a comment, then the block displays the correct who made the last comment.The problem persists only with old articles written prior to updating from IPS from 4.3.X to 4.4.3. Although we've updated the article template, the block is failing to read who made the last comment on the old articles !!! Why ? Regarding your next comment: On 5/29/2019 at 4:58 PM, bfarber said: On the surface my hunch is that you disabled "bumping" the record when a new comment is made (in the database settings), but I can't be certain without viewing the site and the configuration. I've attached two images below: So the block displays the information, first depending on the last article added and then watches who made the last comment. So, from this point of view the settings I think are OK. It remains in question what we were saying above - see the red text.
opentype Posted June 4, 2019 Posted June 4, 2019 9 minutes ago, donpetru said: Although we've updated the article template, the block is failing to read who made the last comment on the old articles !!! Why ? This data isn’t “read” from the actual comment data. Last commenter actions are stored in the record database with each record. So if there is faulty data in there, changing the template won’t do anything. Only updating the record itself (e.g. through a new comment) would change something. As bfarber already said: If you want this investigated, have staff look at the site directly through a support ticket.
bfarber Posted June 4, 2019 Posted June 4, 2019 Yeah, this sounds like you have some older records with incorrect data and really the only way we could diagnose on this end any further is through a ticket.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.