Jump to content

TSP

Clients
  • Posts

    6,675
  • Joined

  • Last visited

  • Days Won

    9

 Content Type 

Downloads

Release Notes

IPS4 Guides

IPS4 Developer Documentation

Invision Community Blog

Development Blog

Deprecation Tracker

Providers Directory

Forums

Events

Store

Gallery

Posts posted by TSP

  1. On 7/2/2023 at 6:19 PM, Canis said:

    Still no reply.

    Sorry for the delay, things have unfortunately been hectic on my end. It also turned out I locally had a slightly different version of 1.2.3 which caused me not be able to reproduce. 

    I've seen in a new minor update, 1.2.3.1, for Marketplace review. Hopefully it gets approved soon, I've sent a headsup to someone at Invision 🙂

  2. 13 hours ago, Canis said:

    Installed today on 4.7.10. Seems to work, but ACP/Support gives a PHP8 critical incompatibility error.
    Using PHP Version 8.1.19.

    Hi, could you post the error here or send me a PM? I don't get any such warnings myself. 

  3. It seems the only way to get push alerts on iOS is to choose "Standalone" as the display mode in the manifest.

    Problem I see is that if any page in the community takes a bit long too load, it looks to the user as if nothing is happening. In the standard Safari iOS browser you can see the loading indication under the address bar that pops up when you click something, but nothing like that appears in a standalone web-app. 

    Obviously slow loading times should be investigated and resolved, but I feel there should still be some feedback from the UI that loading is in progress, otherwise the user will just try to click multiple times. 

    I'm not sure if there's something that could be added to the manifest to resolve this, or if you could work on something else, but I think you should investigate some UX improvement here.

  4. I'll be working on a project in a few weeks which would require parts of the community to be embeddable on an external site. They should be able to do basic actions such as registering, logging in, reading topics and replying to topics all within the iframe on the external site. The height reserved for the iframe on the external site should be dynamic and change whenever the height of the embedded page changes. 

    My idea thus far is to solve this by asking them to include an iframe on the external page. I'll obviously be adding a Content Security Policy so the community can't be included everywhere. 

    My initial thought on the approach to do this would be to create a separate page or pages on the community where I add the required elements one by one/create the templates/CSS/javascript etc. from "scratch". So for example the URL for the iframe would be:

    Community.com/iframe/Topic.php?tid=10000

    However, I'm starting to think that a better apporach might be to solve this by creating a very simplified and stripped down theme optimized for iframe-embedding. That theme would then be used automatically when the community is embedded in an iframe and/or when a certain URL-parameter is added to the URL, for example: invisioncommunity.com/forums/topic/458426-critical-resource-updates/?display=iframe

    Which approach would you recommend, and do you have any other tips or things I should be aware of?

    I'm just sort of in the phase of thinking a bit about it in the back of my mind, so any pointers and hints on the best ways to approach and develop this, and the tools to use, would be appreciated! 

     

  5. I'll also jump in here and confirm that our moderators get this error a lot. 

    Examples: 

    Unknown or bad format (P-1Y11M24DT2M3S)
    #0 /data/ipsdiskcache/prod/template_2_e554b6dcaef0395bbd7d6d63ba187d0a_modcp.php(6271): DateInterval->__construct('P-1Y11M24DT2M3S')
    #1 //system/Theme/SandboxedTemplate.php(61): IPS\Theme\Cache\class_core_front_modcp->warnHovercard(Object(IPS\core\Warnings\Warning))
    #2 //applications/core/modules/front/system/warnings.php(116): IPS\Theme\_SandboxedTemplate->__call('warnHovercard', Array)
    #3 //system/Dispatcher/Controller.php(107): IPS\core\modules\front\system\_warnings->view()
    #4 //system/Content/Controller.php(50): IPS\Dispatcher\_Controller->execute()
    #5 //applications/core/modules/front/system/warnings.php(42): IPS\Content\_Controller->execute()
    #6 //system/Dispatcher/Dispatcher.php(153): IPS\core\modules\front\system\_warnings->execute()
    #7 //index.php(13): IPS\_Dispatcher->run()
    #8 {main}
    
    
    Exception: Unknown or bad format (P-1Y11M24DT2M3S) (0)
    #0 //applications/core/sources/Warnings/Warning.php(400): DateInterval->__construct('P-1Y11M24DT2M3S')
    #1 //system/Content/Item.php(463): IPS\core\Warnings\_Warning->processAfterCreate(NULL, Array)
    #2 //system/Content/Item.php(143): IPS\Content\_Item::createFromForm(Array, NULL)
    #3 //applications/core/modules/front/system/warnings.php(140): IPS\Content\_Item::create()
    #4 //system/Dispatcher/Controller.php(107): IPS\core\modules\front\system\_warnings->warn()
    #5 //system/Content/Controller.php(50): IPS\Dispatcher\_Controller->execute()
    #6 //applications/core/modules/front/system/warnings.php(42): IPS\Content\_Controller->execute()
    #7 //system/Dispatcher/Dispatcher.php(153): IPS\core\modules\front\system\_warnings->execute()
    #8 //index.php(13): IPS\_Dispatcher->run()
    #9 {main}
    
    #0 //init.php(1029): IPS\_Log::log('Exception: Unkn...', 'uncaught_except...')
    #1 [internal function]: IPS\IPS::exceptionHandler(Object(Exception))
    #2 {main}

     

  6. I see the following error a lot in our system logs after updating from PHP 7.4 to 8.1:

    TypeError: in_array(): Argument #2 ($haystack) must be of type array, int given (0)
    #0 /*/system/Content/Content.php(1714): in_array(300, -1)
    #1 /*/system/Content/Controller.php(3001): IPS\_Content->report('', '2')
    #2 /*/system/Content/Controller.php(2271): IPS\Content\_Controller->_report('IPS\\forums\\Topi...', Object(IPS\forums\Topic\Post), Object(IPS\forums\Topic))
    #3 /*/applications/forums/modules/front/forums/topic.php(1240): IPS\Content\_Controller->__call('_report', Array)
    #4 /*/system/Dispatcher/Controller.php(107): IPS\forums\modules\front\forums\_topic->__call('reportComment', Array)
    #5 /*/system/Content/Controller.php(50): IPS\Dispatcher\_Controller->execute()
    #6 /*/applications/forums/modules/front/forums/topic.php(39): IPS\Content\_Controller->execute()
    #7 /*/system/Dispatcher/Dispatcher.php(153): IPS\forums\modules\front\forums\_topic->execute()
    #8 /*/index.php(13): IPS\_Dispatcher->run()
    #9 {main} 

    This TypeError doesn't prevent the report from being submitted, but it causes a redirect in the browser (because of an ajax call not receiving the expected reply) to the report page for the content, where the user will be told they've already reported it.

    Could contain: Page, Text

     

    In Content.php at or around line 1714:

    <?php
    if ( ! in_array( $item->mapped('container'), $perms[ $container::$modPerm ] ) )

    As seen in the error pasted above, the first parameter was 300 (referring to the forum id), while the second parameter supplied is -1. 

    The value of $container::$modPerm is "forums", and the value of $perms['forums'] is just -1. This is because, while the moderator or moderator groups is restricted, they are unrestricted in which forums they are able to operate, and then you save it as -1 to the forums-key in the json value for the perms-column in ibf_core_moderators. 

    Could contain: Page, Text

     

  7. After upgrading the server of one of our communities from PHP 7.4 to 8.1 I found the following error message popping up a lot: 

    TypeError: count(): Argument #1 ($value) must be of type Countable|array, string given in /www/system/Data/Cache.php:151

    This was caused by some custom code being referenced in a custom theme which requested a value with \IPS\Data\Cache::getWithExpire. This is how that function looks currently: 

    <?php
    public function getWithExpire( $key, $fallback=FALSE )
    	{
    		if ( !isset( $this->$key ) )
    		{
    			throw new \OutOfRangeException;
    		}
    		
    		$data = $this->$key;
    		if( \count( $data ) and isset( $data['value'] ) and isset( $data['expires'] ) )
    		{
    			// ...
    		}
    		else
    		{
    			unset( $this->$key );
    			throw new \OutOfRangeException;
    		}
    	}

    After some debugging I found that $data was indeed a string, and thus can't be counted. My first thought was that you should change from \count( $data ) to \is_array( $data ) in this function, which I still think you should, but the next mystery was to figure out why it would be a string, since you always expect it to be an array, and I used the regular storeWithExpire to save to Cache.

    I found the culprit to be former abundance of caution, or what might have been a good reason at the time I implemented it (many many years ago): My code would first request the cache key from \IPS\Data\Cache::getWithExpire. If it didn't find it saved in Cache or it was expired, it would move on to check \IPS\Data\Store, with a 1/15 chance of unsetting it in \IPS\Data\Store to prevent the value from "never" being updated. If it didn't find it in any of them, then it would request the value from an external source and save it to both Data\Cache and Data\Store.

    But if both methods utilizes Redis, then it means the second method will just overwrite the cache entry that the first one saved. Data\Cache stores an array to the cache key in Redis, but then Data\Store would immediately overwrite the same cache entry with a string. 

    You can reproduce with this code: 

    <?php
    require_once 'init.php';
    $cacheKey = 'storeItPlease3';
    $saveToCache = 'Hello world :-) | ' . date(DATE_RFC2822);
    $expire = \IPS\DateTime::ts( time() + 60 );
    
    try
    {
        $cached = \IPS\Data\Cache::i()->getWithExpire( $cacheKey, TRUE );
        echo $cached . "\n";
    }
    catch ( \OutOfRangeException $e )
    {
            try {
                    $cached = \IPS\Data\Store::i()->{$cacheKey};
                    echo "Found in store: {$cached}\n";
              		if ( rand(1, 15) == 15 )
    				{
    					unset(\IPS\Data\Store::i()->{$cacheKey});
    				}
            }
            catch(\OutOfRangeException $e2) {
                    echo "Couldn't find in Data\Store!\n";
            }
        echo "Didn't find {$cacheKey}. Write it!\n";
        \IPS\Data\Cache::i()->storeWithExpire( $cacheKey, $saveToCache, $expire, TRUE );
        \IPS\Data\Store::i()->{$cacheKey} = $saveToCache;
    }

    While I understand this kind of situation arising being rare and you probably don't expect people using both methods simultaneously like this, I thought I would still make you aware of it in case you encounter similar reported issues in the future and maybe make some changes to your code. Having a key name be the same in both Store and Cache could also happen by accident, although I guess the chance is rare.
     

    1. Consider use is_array() rather than, or in addition to count() in \IPS\Data\Cache::getWithExpire (Do you even need that first check, maybe it's enough with the isset()-calls?)
       
    2. Consider prepending or appending to the cache key for one of the storage methods to differentiate entries in Redis saved by Store and Cache
      (Alternatively document that one shouldn't use a key for Store that's already used by Cache or vice versa)
  8. I activated the \IPS\CACHING_LOG to debug some issues, but I noticed that I could only open the dialog/modal for the top ones, the cache entries near the bottom I was unable to open the dialog for. 

    Looking into the HTML, the issue seems to be caused by a sudden change in the naming style of the div that's referenced by data-ipsDialog-content. See the attached image: 

    Could contain: Monitor, Computer Hardware, Screen, Hardware, Electronics, Text, File

    For the working items (that brings up the dialog) the form of the name is #elCachingLog<timestamp>_<id>_menu, but then it suddenly changes to #elCachingLog<timestamp>,<id>_menu (It uses , instead of _ between the timestamp and id)

  9. 21 hours ago, Fast Lane! said:

    But if I only have 7.4 installed I would prefer to upgrade to 4.7.3.  That way I can flip to PHP 8 and check for anything breaking on other parts of my site that aren’t managed by IPB. If there are issues I could flip back to 7.4 (in a minute).  If I upgrade to 4.7.4 I could not flip back, even temporarily. 
     

    Once all is clear on all fronts we could proceed to 4.7.4.  

    This is what I would've done. I was in a similar situation as you, but I got us upgraded from 4.5 to 4.7.3 last week. This week I'm in the process of upgrading our servers to PHP 8.1.

    Then I might try to update to 4.7.4 sometime next week. 

    So download 4.7.3 now from the client area and do a manual upgrade on PHP 7.4. Then update to PHP 8 and then update to 4.7.4++

  10. Hi, 

    On topics with a lot of replies the moderator history log can contain a lot of edited comments. Could you consider automatically filter out editing actions where the author of the post and the member editing the post is the same?

    Or let us be able to filter out these editing actions of ones own posts manually, by providing a checkbox we can check, or something.

    While you're at it, you could even consider introducing more filter options for this tool. For example being able to choose which actions to show. (multi-checkbox)

    But I think the most useful filter option, that makes the most sense, is to filter out moderation actions where an account edits one of their own comments. 

    This is one example from our community:

    Could contain: Electronics, Screen, Text, Computer

    Thank you for the consideration. 

  11. Could you allow us to increase from for example mediumint to int without the database checker complaining/fixing? 

    I have a forum where I every time have to manually fix member_posts-column because some member is above the limit of mediumint. 

    In my opinion I would say that we should be able to change this, as long as it's change that is able to contain a bigger integer value. 

  12. I've also received this feedback from multiple members and communities, that members find it confusing they are all marked as unread when opening the notifications. 

    On 8/16/2021 at 7:36 PM, Jim M said:

    I'm afraid, that there are no further settings for changing this but I have moved this to our Feature Suggestions forum for further evaluation.

    Has there been any more discussion on this internally?

  13. I tried to change the image titles here: 

     

    By editing the post, and double clicking the images, you get additional options. 

    One of those options is "Image title", which on this community, and other cloud communities, is by default generated text by some AI recognition-service. 

    I changed these image titles, but upon saving the post, the old AI-generated captions is still there on hover, even after a refresh. And if you edit the post again, you can see it's back to the AI generated captions when double clicking the images. 

  14. I currently send some datalayer-information in the themes of the forums I manage. 

    I saw that you've implemented a datalayer-section and decided to take a peak at whether it would make sense for me to utilize that instead. Initial thoughts is that I'll likely just continue use my own code in our themes. 

    The information we analyze the most in Google Analytics is these two things: 

    • Comparing guests vs those logged in
    • Which sections are most popular and traffic change etc. for each section

    In your current implementation you only send information about the closest container. What I would suggest is that you also include the entire breadcrumb data in the default language.

    Here’s an example of information I provide, when inside a topic in A Test Category/A Test Forum/Subforum. I provide the same breadcrumb data if viewing the forum, but the controller within the location variable would be forums instead of topic. 

    dataLayer = [{
    	'adblocker': adblock,
    	'isLoggedIn': isLoggedIn,
    	'location': {app:"forums", module:"forums", controller:"topic"},
    	'isContentPage': isContentPage,
    				
    	'breadcrumb': ["A Test Category","A Test Forum","Subforum"],
    	'breadcrumbObj': {"section1":"A Test Category","section2":"A Test Forum","section3":"Subforum"},
    	'breadcrumbPath': 'A Test Category/A Test Forum/Subforum',

    I have it duplicated a bit unnecessarily for … what was probably good reasons once upon a time.

    When you have a large community with a lot of sections that each contain numerous forums, and subforums to subforums etc., it makes more sense for us to look at all traffic across all the subforums in a section and then go further down into specific forums from there. 

    As for my other suggestions it would be to include whether the visitor is logged in or not. Currently you only sort of provide this information if PII is enabled, but I would suggest you just provide an additional true/false field by default, and not having to enable all PII to get data on guests vs logged in.

×
×
  • Create New...