Jump to content


  • Posts

  • Joined

  • Days Won


 Content Type 


Release Notes

IPS4 Guides

IPS4 Developer Documentation

Invision Community Blog

Development Blog

Deprecation Tracker

Providers Directory





Everything posted by teraßyte

  1. 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 )
  2. 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.
  4. The API currently allows only 3 options: Create a new personal conversation Add a reply to an existing personal conversation Delete an existing personal conversation There is no way to list/retrieve a member's personal conversations right now. 🤷‍♂️
  5. Disabling the right click is not an effective way at all. There are countless ways to bypass that limitation (disable javascript, scrape the site, look at the image URL in the page's source, etc.). Personally, I think it's a waste of time even trying. 🙄 I'm unaware of any 3rd party plugin that does this, but there are several such examples if you just search for them (Google, Bing, etc). If you still want to go ahead with it, find some JavaScript code and add it to your theme.
  6. You need to establish a connection to the external/remote database you want to use, and then run the queries with the usual framework code to retrieve/display the data: The first codebox shows an example of how to start an external database connection.
  7. No, you're not missing it. There is no option in Invision Community for that. I've seen modifications to hide images for specific groups, but not based on the member's age if they're logged in.
  8. I'm not sure how it happened, but the same user was able to react twice to one of my posts here on this forum: You can see there are 2 Thanks reactions from the same user. I also received 2 separate inline notifications for it.
  9. Yes, you need to add your own API key now. The default API key stopped working almost 1 year ago:
  10. I usually wait 1-2 weeks after a new release to avoid exactly this kind of issues. The time is usually enough for IPS to release a patch for any major issues.
  11. You can use Staff Messages: Keep the message private, and only moderators will ever see it.
  12. You guys should really consider adding a maximum PHP version check both in the suite and the requirements checker. I'm not saying to lock everything with the wrong version, even a simple warning in ACP would to the job. With a simple check for the maximum version, you'd avoid dozens of support requests... 🙄
  13. Sorry, that doesn't help. Can you post here a few of those queries? That said, since you mentioned the _new suffix, I think your database might not be utf8mb4. Does the Support page in ACP list any errors for the MySQL database?
  14. What kind of queries are you being asked to run exactly? There were a few changes, but not that many. 🤔
  15. From the js file (line 61): ips.createModule('ips.ui.uploader', function(){ To create a new one you need to copy/paste the file in your app, change the name, update the names/references, edit the code you need, and call the new module's name in the HTML. This is the code that registers the module (I'll use the dialog one which is more used): ips.ui.registerWidget('dialog', ips.ui.dialog, [ 'url', 'modal', 'draggable', 'size', 'title', 'close', 'fixed', 'destructOnClose', 'extraClass', 'callback', 'content', 'forceReload' , 'flashMessage', 'flashMessageTimeout', 'flashMessageEscape', 'showFrom', 'remoteVerify', 'remoteSubmit' ], { lazyLoad: true, lazyEvents: 'click' } ); You need to change the dialog name (maybe dialogbis) which registers the widget. All the other values in the array are the options you can use inline. This is how the code would be with the original dialog module: <div data-ipsDialog data-ipsDialog-title="TITLE" data-ipsDialog-remoteSubmit data-ipsDialog-flashMessage="ITEM SUBMITTED"> This is how it would look with your updated dialogbis module: <div data-ipsDialogbis data-ipsDialogbis-title="TITLE" data-ipsDialogbis-remoteSubmit data-ipsDialogbis-flashMessage="ITEM SUBMITTED">
  16. The ips.ui.uploader.js file is a module, and there's no option to extend modules in the framework as far as I know. Let's hope something about it changed in v5. 🙄 Your only option currently is to create a separate module (with a different/similar name), change only the code you need, and add the new module to the HTML.
  17. The same permission problem happens with the fluid view in the forums application loading extra topics. I think it's the same root issue in the code that checks the item permissions and loads them. IPS already mentioned they're working on a patch to fix several issues, it should be coming out in the next 1-2 days.
  18. You also need to upload the files to the server before clicking Continue. Have you done that step?
  19. Edit the theme's settings (pencil icon; not the HTML/CSS) and you'll find a color setting with the name Tags Background in the Front-End Colors tab.
  20. The widgets are cached based on the time you have setup in ACP. The default is 5 minutes, but the update delay will be bigger if you've increased the caching time. You can check the setting in ACP > System > Advanced Configuration > Server Environment TAB > Cache sidebar, header and footer blocks. The photo disappearing, I'm not sure. 🤨
  21. There is some unused code in the Authy handler file /system/MFA/Authy/Handler.php in the verifyApiKey() function at the end of the file: public static function verifyApiKey( $val ) { try { return \IPS\Http\Url::external("https://api.authy.com/protected/json/app/details")->setQueryString( 'api_key', $val )->request()->get()->decodeJson(); } catch ( \IPS\Http\Request\Exception $e ) { throw new \DomainException( $e->getMessage() ); } if ( !$response['success'] ) { throw new \DomainException( $response['message'] ); } } The IF after the TRY/CATCH is never executed, it either returns inside the TRY or throws an exception in the CATCH: if ( !$response['success'] ) { throw new \DomainException( $response['message'] ); } It can be removed.
  22. @superaven Have a look at this post from Matt for a (rough) timeline:
  23. While members can disable it from their profile (admins can also edit profiles in ACP), there is no global setting to disable it for everyone. You can either remove the block from the profile's template or hide it with a custom modification.
  24. @micahdg Your screenshot says PHP 8.2. Try downgrading to 8.1 because 8.2 is not supported. This comes up often. IPS should really update the requirements checker script to throw an error for PHP 8.2+. I've already seen some people use even 8.3... 🙄
  • Create New...