Jump to content

Afrodude

Members
  • Posts

    912
  • Joined

  • Days Won

    7

Reputation Activity

  1. Agree
    Afrodude reacted to Kirill Gromov in Invision Community 5: The all-new editor   
    For example, I add a class to an embedded YouTube video to center it. The embedded block does not respond to the centering buttons from editor.
  2. Like
    Afrodude reacted to NexusMods in View Updates task failing with redis   
    Hi, we are seeing issues with the viewupdates task in the system logs:

    ArgumentCountError: Wrong parameter count for Redis::zRem() (0)
    #0 /var/www/html/system/Redis/Redis.php(250): Redis->zRem('topic_views')
    #1 /var/www/html/applications/core/tasks/viewupdates.php(86): IPS\_Redis->__call('zRem', Array)
    #2 /var/www/html/system/Task/Task.php(375): IPS\core\tasks\_viewupdates->IPS\core\tasks\{closure}()
    #3 /var/www/html/applications/core/tasks/viewupdates.php(38): IPS\_Task->runUntilTimeout(Object(Closure))
    #4 /var/www/html/system/Task/Task.php(274): IPS\core\tasks\_viewupdates->execute()
    #5 /var/www/html/system/Task/Task.php(237): IPS\_Task->run()
    #6 /var/www/html/applications/core/interface/task/task.php(72): IPS\_Task->runAndLog()
    #7 {main}

    It seems adding an !empty check on the $redis array in viewupdates.php fixes the error:

     
    if( \is_array( $redis ) && !empty($redis) ) { foreach ( $redis as $data => $count )  
  3. Like
    Afrodude reacted to teraßyte in [BUG 4.7.16] Editor buttons are still displayed despite being disabled for the area   
    This issue is reproducible only on a page with 2 editors with each having a different area assigned:
    Create a page with 2 editors in it. Let's say the editors use the following keys in the same application: EditorA EditorB  
    Case 1: Disable the button ONLY for editor A
    The button is disabled for both editors A and B.
     
    Case 2: Disable the button ONLY for editor B
    The button is visible for both editors A and B.
     
    ===
    If you have 2 editors (A & B) that use 2 different areas on the same page, the cached result of the first editor (A) displayed on the page is always used for the second editor (B) without checking if the button is actually available also for the second area.
     
    This issue is caused by the static function \IPS\Text\Parser::canUse( $member, $key, $area ) because it caches the result of each button only using 2 values: member_id and $key:
    static::$permissions[ $member->member_id ][ $key ];  
    The $area value is only checked if there is no cached result:
    /** * Can use plugin? * * @param \IPS\Member $member The member * @param string $key Plugin key * @param string $area The Editor area * @return bool */ public static function canUse( \IPS\Member $member, $key, $area ) { $permissionSettings = json_decode( \IPS\Settings::i()->ckeditor_permissions, TRUE ); if ( !isset( static::$permissions[ $member->member_id ][ $key ] ) ) { if ( !isset( $permissionSettings[ $key ] ) ) { static::$permissions[ $member->member_id ][ $key ] = TRUE; } else { $val = TRUE; if ( $permissionSettings[ $key ]['groups'] !== '*' ) { if ( !$member->inGroup( $permissionSettings[ $key ]['groups'] ) ) { $val = FALSE; } } if ( $permissionSettings[ $key ]['areas'] !== '*' ) { if ( !\in_array( $area, $permissionSettings[ $key ]['areas'] ) ) { $val = FALSE; } } static::$permissions[ $member->member_id ][ $key ] = $val; } } return static::$permissions[ $member->member_id ][ $key ]; }  
     
    If you also want to slightly optimize the code, the json_decode() call can be moved inside the first IF since the data isn't used if a cached result is found.
  4. Like
    Afrodude reacted to teraßyte in [BUG 4.7.16] Exception thrown when editing a member's restrictions in ACP with Downloads application   
    This exception is thrown when editing a member's Warnings & Restrictions from an ACP profile:
    Whoops\Exception\ErrorException thrown with message "Undefined array key "idm_block_submissions"" Stacktrace: #7 Whoops\Exception\ErrorException in \system\Patterns\Bitwise.php:112 #6 Whoops\Run:handleError in \system\Patterns\Bitwise.php:112 #5 IPS\Patterns\_Bitwise:offsetGet in \applications\downloads\extensions\core\MemberRestrictions\Downloads.php:48 #4 IPS\downloads\extensions\core\MemberRestrictions\_Downloads:save in \applications\core\extensions\core\MemberACPProfileBlocks\Warnings.php:130 #3 IPS\core\extensions\core\MemberACPProfileBlocks\_Warnings:edit in \applications\core\modules\admin\members\members.php:1307 #2 IPS\core\modules\admin\members\_members:editBlock in \system\Dispatcher\Controller.php:107 #1 IPS\Dispatcher\_Controller:execute in \system\Dispatcher\Dispatcher.php:153 #0 IPS\_Dispatcher:run in \init.php:934  
    The issue is caused by the save function's code in /applications/downloads/extensions/core/MemberRestrictions/Downloads.php (line 48):
    public function save( $values ) { $return = array(); if ( $this->member->idm_block_submissions == $values['idm_block_submissions'] ) { $return['idm_block_submissions'] = array( 'old' => $this->member->members_bitoptions['idm_block_submissions'], 'new' => !$values['idm_block_submissions'] ); $this->member->idm_block_submissions = !$values['idm_block_submissions']; } return $return; }  
    The value for the old array key is using the wrong "bitoptions" syntax:
    $this->member->members_bitoptions['idm_block_submissions'] when it should be:
    $this->member->idm_block_submissions
  5. Agree
    Afrodude reacted to WebCMS in Pasted text background color using themes   
    It would be ideal for the IC Team to add this block to whatever template it is so all clients don't have to add it to their templates redundantly. This is the solution and you just have to add it and test. This small change which belongs in the core would resolve a BIG pain point.
    The last thing clients want to do is modify templates and maintain/re-apply the changes across updates.
  6. Agree
    Afrodude reacted to David N. in I see a queued post listed, however I can't find it?   
    Ok I finally found the red warning side plus number, however it was hidden inside the "HOT!" badge and thus invisible to the naked eye (red on orange background). 
    Looks like the warning side should not be inside that "HOT!" badge?

  7. Like
    Afrodude reacted to teraßyte in Retrieving plugin?   
    No. While you can download an application's folder from the server, plugins aren't the same. When plugins are installed, the setup folder is NOT saved on the server. And the original XML file is not available, either.
    You'll need to rebuild the XML file from scratch based on the files on the server, plus rewrite from scratch the setup folder (if the plugin creates tables or adds columns).
     
    It may take some time, but it can be done. I've done it several times for clients, especially recently after the marketplace closed.
  8. Agree
    Afrodude reacted to Gary in Can I post a clickable image?   
    For the record, @Patham, there is no such thing as a silly question. Everyone has different abilities when it comes to forum software and the internet in general. The only way to learn is to ask as many questions as you can. I find myself asking questions performing certain functions purely because something I had to do when releasing one community, I didn't do until years later when I created another community.
    Glad you found a solution in the end though.
  9. Agree
    Afrodude reacted to Andreas Grace in PHP 8.2 Thread   
    As a matter of principle, PHP 8.2 should be supported officially for v4 in the next months. PHP 8.1 is already in security-only support and that expires on 25 Nov 2024.
  10. Agree
    Afrodude reacted to David N. in Profile: "Last Visited" should state "online now" when user is online   
    Last Visited should state "Online Now" when a user is still online (the same way the hover card currently displays it). 
    The way it works now is a bit odd, as mentioned in the following threads: 
  11. Like
    Afrodude reacted to David N. in [Bug] Last Visited   
    Yes, I read what @Matt wrote.
    I understand the technical reason behind the behavior. I also agree with Matt that it looks odd (to say the least), and I am hoping that a better solution can be implemented. 
    IMO the profile page should say "online now" until the user's session times out. I don't suppose there should be a privacy concern since we can already see "online now" in the user's hover card anyway? 
  12. Like
    Afrodude reacted to David N. in [Bug] Last Visited   
    I am also seeing this in my community, for example a user last visited 33 minutes ago but posted 9 minutes ago. 
    Or here's another example: 

  13. Like
    Afrodude reacted to David N. in User last visited 32 minutes ago (and yet posted 8 minutes ago)?   
    Turns out it's not a cache issue; the issue was reported before there: 
  14. Like
    Afrodude got a reaction from David N. in [Bug] Last Visited   
    Last visit was 20 minutes ago

    at 05:52 AM

     
    Home come he manage to post a reply after 10 minutes from his last visit while he was already away!!!!?????
  15. Like
    Afrodude reacted to teraßyte in REST API /cms/records/{databaseId} POST fails with 500 in 4.7.16   
    Looking again at the screenshot, the error is being thrown when a revision for the record is added to the database, not when the record itself is added. If you're adding a new record, it shouldn't store a revision. A revision should be saved only when you edit a record.
     
    The problem is in /applications/cms/api/records.php in the _createOrUpdate() function (lines 424-443):
    /* Store a revision before we change any values */ if ( $item::database()->revisions ) { $revision = new \IPS\cms\Records\Revisions; $revision->database_id = $item::$customDatabaseId; $revision->record_id = $item->_id; $revision->data = $item->fieldValues( TRUE ); if ( $this->member ) { $memberId = $this->member->member_id; } else { $memberId = $item->author()->member_id; } $revision->member_id = $memberId; $revision->save(); }  
    The IF check should also check if you're editing a record because when adding a new one there is no record ID available yet (thus the column NULL error):
    if ( $type == 'edit' AND $item::database()->revisions )
  16. Like
    Afrodude reacted to teraßyte in Error when creating CMS record via REST API   
    It's indeed the same issue.
    I posted a fix here if you can't wait for IPS to fix it in the next (?) version:
  17. Like
    Afrodude reacted to teraßyte in [BUG 4.7.16] The s3Delete task is not activated correctly when deleting an Amazon S3 container   
    In the file /system/File/Amazon.php inside the function deleteContainer() this code is executed when adding a new delete task to delete the files in a bucket folder (container):
    /* Turn on task */ \IPS\Db::i()->update( 'core_tasks', array( 'enabled' => 1 ), array( '`key`=?', 's3_delete' ) ); The problem is that the task's key is not s3_delete but s3Delete (no space + capitalized). This causes the task to delete the S3 files to not activate correctly.
     
    The same issue is also present inside the code of the s3Delete task to disable itself in 2 different locations.
    Lines 44-50:
    if ( !( $obj instanceof \IPS\File\Amazon ) ) { /* Class is not Amazon, so just stop here and truncate the table as there's nothing we can really do now. */ \IPS\Db::i()->delete( 'core_s3_deletions' ); \IPS\Db::i()->update( 'core_tasks', array( 'enabled' => 0 ), array( '`key`=?', 's3_delete' ) ); return NULL; } Lines 96-97:
    /* Nothing to do, so switch off the task */ \IPS\Db::i()->update( 'core_tasks', array( 'enabled' => 0 ), array( '`key`=?', 's3_delete' ) );  
    Again s3_delete is being used instead of s3Delete.
  18. Agree
    Afrodude reacted to Marc Stridgen in Issues with blogs   
    This has been added as feedback as a suggestion to change. If you are reporting something you believe to be a bug, you should report this in our technical problems area. Feedback, while read, will not always be responded to.
    In the case of this one, it appears to be a suggestion for change in the software in multiple areas. I would highly suggest ensuring you are adding each suggestion as a separate item, as this appears to start with URLs, go to slideshows and end with tags
    With suggestions, we cannot guarantee that an item will be added or changed when you post. We can guarantee only that its read and may be considered. What we can certainly guarentee is if they are not posted, we wouldnt even know you wish to have them of course
  19. Agree
    Afrodude reacted to WebCMS in Issues with blogs   
    Would appreciate if someone confirms that these issues have been added to your bug model; otherwise, all that testing, recording issues and reporting issues would be for nothing.
  20. Agree
    Afrodude reacted to teraßyte in Invision Community 5: Assign topics to moderators   
    I don't think normal members will be able to see that someone is assigned to the topic. I might be wrong, though. 🙄
  21. Like
    Afrodude reacted to teraßyte in Where are Followers of a Member stored?   
    The data is in the core_follow table. They need to filter by:
    follow_app=core follow_area=member follow_rel_id=XXX (where XXX is the member ID)
  22. Like
    Afrodude reacted to Kirill Gromov in Bug with rating   
    Hello, I gave this topic a 5 rating. If you hover the cursor over a rating and move the cursor away, the rating does not return to its original value.
    In the ips.ui.rating module there is a line:
    .find('li[data-ratingValue="' + value + '"]') Here value is searched as an integer, but in the code it is a floating number (5.0)..
    <div data-ipsrating="" data-ipsrating-changerate="true" data-ipsrating-size="veryLarge" data-ipsrating-value="5.0" data-ipsrating-userrated="5">  
  23. Like
    Afrodude reacted to teraßyte in [BUG 4.7.16] Incosistent implementation of core extension "EditorLocations::attachmentLookup()"   
    As per the title, the implementation of the extension's EditorLocations::attachmentLookup() method is inconsistent when you don't allow attachments. No matter how I implement it, or which exception I throw, it won't work for all locations.
     
    1) \applications\core\extensions\core\EditorMedia\Attachment.php (lines 140-156):
    The code checks if the method exists before calling it. The code checks for 2 exceptions being thrown: \LogicException \BadMethodCallException if( method_exists( static::$loadedExtensions[$map['location_key']], 'attachmentLookup')) { try { $url = static::$loadedExtensions[$map['location_key']]->attachmentLookup($map['id1'], $map['id2'], $map['id3']); /* Test url() method to prevent BadMethodCallException from the template below - an attachment may be located within a Node class that doesn't support urls, such as CMS Blocks. */ if ($url instanceof \IPS\Content or $url instanceof \IPS\Node\Model){ $url->url(); } static::$locations[$attachId][] = $url; } catch (\LogicException $e) { } catch (\BadMethodCallException $e) { } }  
    2) \applications\core\modules\admin\overview\files.php (lines 209-219):
    The code checks if the method exists before calling it. The code checks for a single exception being thrown: \LogicException if ( isset( $loadedExtensions[ $map['location_key'] ] ) AND method_exists( $loadedExtensions[ $map['location_key'] ], 'attachmentLookup' ) ) { try { if ( $url = $loadedExtensions[ $map['location_key'] ]->attachmentLookup( $map['id1'], $map['id2'], $map['id3'] ) ) { $locations[] = $url; } } catch ( \LogicException $e ) { } }  
    3) \applications\core\modules\front\system\attachments.php (lines 87-100):
    The code doesn't check if the method exists before calling it. The code checks for a single exception being thrown: \OutOfRangeException /* Check Permission */ $exploded = explode( '_', $attachment['location_key'] ); try { $extensions = \IPS\Application::load( $exploded[0] )->extensions( 'core', 'EditorLocations' ); if ( isset( $extensions[ $exploded[1] ] ) ) { $attachmentItem = $extensions[ $exploded[1] ]->attachmentLookup( $attachment[ 'id1' ], $attachment[ 'id2' ], $attachment[ 'id3' ] ); } } catch ( \OutOfRangeException $e ) { \IPS\Output::i()->json( array( 'error' => 'no_permission' ) ); }  
    4) \system\Content\Statistics.php (lines 398-408):
    The code doesn't check if the method exists before calling it. The code checks for a single exception being thrown: \LogicException \BadMethodCallException if ( isset( static::$loadedExtensions[ $map['location_key'] ] ) ) { try { $url = static::$loadedExtensions[ $map['location_key'] ]->attachmentLookup( $map['id1'], $map['id2'], $map['id3'] ); $return[ $k ]['commentUrl'] = (string) $url->url(); } catch ( \LogicException $e ) { } catch ( \BadMethodCallException $e ){ } }  
    ===
    To make a summary of the implementations:
    All OK. It should check for the \BadMethodCallException exception. It should check if the method exists before calling it, and both \LogicException and \BadMethodCallException exceptions aren't being checked. Rather, it checks for a \OutOfRangeException exception which is never thrown according to the method's phpDoc. It should check if the method exists before calling it.  
    I could throw a \LogicException, but as it is it would break implementation #3 anyway.
  24. Like
    Afrodude reacted to Steven W. in [CMS App] Database Record Downloads   
    I've found the database app an interesting tool to build on.  Oddly, there is no ability to download records.  I thought about why this might be and looked at the database.  Is it because the cms_custom_database_n tables use the custom database field id in the column names instead of using the custom database field's field_key value?
    This block in applications/cms/sources/Fields/Fields.php would need to be updated to replace hyphens with underscores:
    if ( \is_array( $values['field_title'] ) ) { /* We need to make sure the internal pointer on the array is on the first element */ reset( $values['field_title'] ); $values['field_key'] = \IPS\Http\Url\Friendly::seoTitle( $values['field_title'][ key( $values['field_title'] ) ] ); } else { $values['field_key'] = \IPS\Http\Url\Friendly::seoTitle( $values['field_title'] ); }  
  25. Haha
    Afrodude reacted to beats23 in Help!! I can't update to the latest version. There are no applications available to upgrade   
    In my book, the latest is always the best. Someone has to be the guinea pig for the rest or there will be a slow evolution. I'll be installing IPSv5 on the first day it drops🙂.
     
×
×
  • Create New...