Jump to content
DevFuse Forums
  • Topic view hook


    Michael
    • Fixed IP.Board Version: IP.Board 4.2.x

    The topic view hook is not showing.

    Manual Patch:

    Open applications/collections/hooks/collectionsTopicView.php

    Find:

    'selector' => 'article[itemtype=\'http://schema.org/Answer\'] > aside.ipsComment_author.cAuthorPane.ipsColumn.ipsColumn_medium > ul.cAuthorPane_info.ipsList_reset',

    Replace With:

    'selector' => 'article > aside.ipsComment_author.cAuthorPane.ipsColumn.ipsColumn_medium.ipsResponsive_hidePhone > ul.cAuthorPane_info.ipsList_reset',

    Save.



    User Feedback

    Recommended Comments

    Hmm, I've just noticed that the very few members that have edited their car after the update to IPS4 have a small "x car(s)" badge in Topic View! Therefore, it appears to we working but doesn't take into account records that haven't been added or edited since the migration. Hope this helps?

    Share this comment


    Link to comment
    Share on other sites
    17 hours ago, cybernck said:

    Hmm, I've just noticed that the very few members that have edited their car after the update to IPS4 have a small "x car(s)" badge in Topic View! Therefore, it appears to we working but doesn't take into account records that haven't been added or edited since the migration. Hope this helps?

    Yep that sounds like the case. The item count wasn't rebuilt properly after the import. Just how many vehicles do you have present? If not too many, running this code should do a full rebuild for you.

    		foreach( \IPS\Db::i()->select( '*', 'collections_items', null, 'id ASC' ) as $row )
    		{
                $item = \IPS\collections\Item::constructFromData( $row );		  
                /* Rebuild item count */
                $item->rebuildItemCount();		
    		}

    So for example, add that into the "manage" function of the applications/collections/modules/admin/collections/settings.php file and then open the collections settings page in the admin. That will perform the rebuild for all your vehicles and get all your members item counts up to date.

    If you do have quite a few vehicles, let me know and can modify to run a subset at a time.

    Share this comment


    Link to comment
    Share on other sites

    It depends on the database and your server but I'd probably try and limit to maybe 100 at a time. So try this query and adjust.

    foreach( \IPS\Db::i()->select( '*', 'collections_items', null, 'id ASC', array( 0, 100 ) ) as $row )
    		{
                $item = \IPS\collections\Item::constructFromData( $row );		  
                /* Rebuild item count */
                $item->rebuildItemCount();		
    		}

    And then adjust the last limit portion to array( 100, 100 ) and then array( 200, 100 ) and so on. Until you get to array( 800, 100 ) to run the last bit. I hope that makes sense.

    21 hours ago, cybernck said:

    I assume I only need to run that code only once and then remove it?

    Yes that's correct. The system will then keep everything up to date itself.

    Share this comment


    Link to comment
    Share on other sites

    I haven't yet run this patch as I've been installing SSL certificate and rebuilding whatever IPS system wanted me to rebuild to support SSL but I've now noticed that all of a sudden there's an error with Vehicle naming - the titles gained paragraph tags?
    https://www.205gtidrivers.com/garage/

    However, a car that has been added today doesn't have them, so it seems that it somehow happened retroactively for the existing items.

    Any idea why?

    Share this comment


    Link to comment
    Share on other sites

    I've now run the script and it has fixed the topic view hook, thanks!

    It's just that it's always in plural, e.g. "1 Cars" ;).

    Any thoughts on the <p> issue? Should I just clean it up in the db itself?

    Share this comment


    Link to comment
    Share on other sites

    The only thing I've done in the meantime was to disable https image recaching, which required some posts to be rebuilt...

    I've now once again removed the tags, so we'll see what happens now and what triggers it.

    Share this comment


    Link to comment
    Share on other sites

    Ah yes, so it's RebuildImageProxy.php causing it. Here's what IPS said about it:

    This is because the Image Proxy Rebuild task is application agnostic, and will perform adjustments on anything an application defines as a content item. For that application, it defines the data in that table as content. If this is undesirable, then I would recommend contacting the author of that application.

    Share this comment


    Link to comment
    Share on other sites
    7 hours ago, cybernck said:

    I've now once again removed the tags, so we'll see what happens now and what triggers it.

    It shouldn't if the posts have all been rebuilt now. But this is a problem due to this bit of code in the applications/collections/sources/Item/Item.php file. The image rebuild is rebuild all content values and sees the item name as something to rebuild.

    'content'        => 'item_name',

    I set it as a content item for some reason but will test removing it in the next version.

    Share this comment


    Link to comment
    Share on other sites


    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Add a comment...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.


  • Status Definitions

    Pending = We are still working on this report.

    Fixed = The issue has been fixed and the resolution will be available in the next version.

    Closed = Feedback or opinion better posted on our forum for discussion. Also for reports we cannot reproduce or need more information. In this case just add a comment and we will review it again.

     

×
×
  • Create New...