BomAle Posted August 13, 2017 Posted August 13, 2017 ON \IPS\Content\Search\Index::indexData /* Or if this *is* the first comment, add the title and replace the tags */ $title = $object->mapped('title'); $isForItem = FALSE; if ( $object instanceof \IPS\Content\Comment ) { $itemClass = $class::$itemClass; if ( $itemClass::$firstCommentRequired and $object->isFirst() ) { $title = $object->item()->mapped('title'); $tags = ( $object->item() instanceof \IPS\Content\Tags and \IPS\Settings::i()->tags_enabled ) ? implode( ',', array_filter( $object->item()->tags() ) ) : NULL; $prefix = ( $object->item() instanceof \IPS\Content\Tags and \IPS\Settings::i()->tags_enabled ) ? $object->item()->prefix() : NULL; $isForItem = TRUE; } } /* Get the last updated date */ if ( $isForItem ) { $dateUpdated = $object->item()->mapped('last_comment'); } else { $dateUpdated = ( $object instanceof \IPS\Content\Item ) ? $object->mapped('last_comment') : $object->mapped('date'); } I suggest to replace ( $object instanceof \IPS\Content\Item ) ? $object->mapped('last_comment') : $object->mapped('date'); //TO ( $object instanceof \IPS\Content\Item ) ? $object->mapped( isset($object::$databaseColumnMap['updated']) ? 'updated' : 'last_comment' ) : $object->mapped('date');
bfarber Posted August 14, 2017 Posted August 14, 2017 Can you elaborate on why you would like to see this change?
HeadStand Posted August 15, 2017 Posted August 15, 2017 I would actually suggest it be the other way - check for last_comment and if it doesn't exist, use updated. (I'm on my phone, I can't properly type code right now.) @bfarber we can have searchable content items that don't have comments (and therefore have no mapping for last_comment), but they still might have a mapping for updated.
bfarber Posted August 16, 2017 Posted August 16, 2017 15 hours ago, HeadStand said: I would actually suggest it be the other way - check for last_comment and if it doesn't exist, use updated. (I'm on my phone, I can't properly type code right now.) @bfarber we can have searchable content items that don't have comments (and therefore have no mapping for last_comment), but they still might have a mapping for updated. Thanks - I've raised this internally for consideration.
bfarber Posted August 22, 2017 Posted August 22, 2017 During discussions about this suggestion it was pointed out that anything that can be 'updated' would get bumped to the top of activity streams, which is inconsistent and not intended. Is there a valid use case for having content that is updated bump to the top of an activity stream?
BomAle Posted August 22, 2017 Author Posted August 22, 2017 When user sort for Updated if some items are edited them must go on first page (for example wiki style content for pages app). I am building a app that when items are updated the activity show the items on "recent updated" feed helping users find real updated items (page polls with optionally have comments). I have not tested but I could extend get_last_comment and check for updated data if setted (not equal 0).
HeadStand Posted August 23, 2017 Posted August 23, 2017 11 hours ago, bfarber said: During discussions about this suggestion it was pointed out that anything that can be 'updated' would get bumped to the top of activity streams, which is inconsistent and not intended. Is there a valid use case for having content that is updated bump to the top of an activity stream? Fair enough. But I would still recommend checking if the last_comment mapping exists instead of assuming it does.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.