Jump to content

teraßyte

Clients
  • Posts

    33,969
  • Joined

  • Last visited

  • Days Won

    59

 Content Type 

Downloads

Release Notes

IPS4 Guides

IPS4 Developer Documentation

Invision Community Blog

Development Blog

Deprecation Tracker

Providers Directory

Projects

Release Notes v5

Invision Community 5 Bug Tracker

Forums

Events

Store

Gallery

Everything posted by teraßyte

  1. This other bug report I made before is also related to the same file/class:
  2. This is the current construct method of the file: public function __construct( Url|string $url, string $languageString, string $css ='ipsMenu_item', array $dataAttributes = [], bool $opensDialog = FALSE, ?string $icon = NULL, string $id = NULL, string $identifier = '' ) { $this->url = $url; $this->title = $languageString; $this->css = $css; $this->dataAttributes = $dataAttributes; $this->icon = $icon; $this->menuItem = $identifier ?: $languageString; if( !$id ) { $id = 'menuLink_' . md5($languageString ) . '_' . $this->identifier; } $this->id = $id; if( $opensDialog ) { $this->opensDialog(); } $this->addAttribute( 'data-menuItem', $languageString); } Here's a list of issues: The $this->identifier variable is always empty when used to create a missing $id. The last line that adds the data-menuItem attribute should use $this->menuItem rather than $languageString. [Not really a bug] After the class values are set at the top you should use those rather than the function variables. Here's the updated code with all the changes if you want to copy/paste it. 😋 public function __construct( Url|string $url, string $languageString, string $css ='ipsMenu_item', array $dataAttributes = [], bool $opensDialog = FALSE, ?string $icon = NULL, string $id = NULL, string $identifier = '' ) { $this->url = $url; $this->title = $languageString; $this->css = $css; $this->dataAttributes = $dataAttributes; $this->icon = $icon; $this->identifier = $identifier; $this->menuItem = $this->identifier ?: $this->title; if( !$id ) { $id = 'menuLink_' . md5($this->title ) . '_' . $this->identifier; } $this->id = $id; if( $opensDialog ) { $this->opensDialog(); } $this->addAttribute( 'data-menuItem', $this->menuItem ); }
  3. The guide states: https://invisioncommunity.com/developers/docs/other-features/commerce/using-the-license-key-api-in-commerce-r75/ However, setting the setIdentifier variable to 1 sets the identifier value to 1 because it uses the setIdentifier value itself instead of the provided identifier value: $identifier = $this->getIdentifier( $key ); $providedIdentifier = isset( Request::i()->identifier ) ? Request::i()->identifier : NULL; if ( isset( Request::i()->setIdentifier ) and Request::i()->setIdentifier ) { if ( $identifier != $providedIdentifier ) { if ( $identifier or in_array( $key->identifier, array( 'name', 'email', 'username' ) ) ) { throw new ApiException( 'BAD_KEY_OR_ID', 101 ); } else { $cfields = $key->purchase->custom_fields; $cfields[ $key->identifier ] = Request::i()->setIdentifier; $key->purchase->custom_fields = $cfields; $key->purchase->save(); } } } elseif( $identifier != $providedIdentifier ) { throw new ApiException( 'BAD_KEY_OR_ID', 101 ); } The problem is on line 160: $cfields[ $key->identifier ] = Request::i()->setIdentifier; For it to work as the guide describes, it should be changed to: $cfields[ $key->identifier ] = $providedIdentifier;
  4. Here are the steps to reproduce: Create a product Custom Field with the following settings Field Type: URL Leave all the other Yes/No settings disabled. Create a new product that generates a License Key and assign the custom field from #1 as the Identifier value. (I used a maximum of one use, but it shouldn't matter.) Now purchase the new product from the front end. View the purchase in ACP => It throws the following exception: Whoops\Exception\ErrorException thrown with message "trim(): Passing null to parameter #1 ($string) of type string is deprecated" Stacktrace: #5 Whoops\Exception\ErrorException in \applications\nexus\modules\admin\customers\purchases.php:128 #4 trim in \applications\nexus\modules\admin\customers\purchases.php:128 #3 IPS\nexus\modules\admin\customers\purchases:view in \system\Dispatcher\Controller.php:128 #2 IPS\Dispatcher\Controller:execute in \applications\nexus\modules\admin\customers\purchases.php:87 #1 IPS\nexus\modules\admin\customers\purchases:execute in \system\Dispatcher\Dispatcher.php:169 #0 IPS\Dispatcher:run in \admin\index.php:15 View the purchase on the front end => It throws the following exception: TypeError thrown with message "IPS\Helpers\Form::addDummy(): Argument #2 ($value) must be of type string, null given, called in \applications\nexus\sources\Package\Package.php on line 2507" Stacktrace: #10 TypeError in \system\Helpers\Form\Form.php:437 #9 IPS\Helpers\Form:addDummy in \applications\nexus\sources\Package\Package.php:2507 #8 IPS\nexus\Package:clientAreaPage in \applications\nexus\extensions\nexus\Item\Package.php:822 #7 IPS\nexus\extensions\nexus\Item\Package:clientAreaPage in \applications\nexus\sources\Purchase\Purchase.php:884 #6 IPS\nexus\Purchase:clientAreaPage in \system\Theme\Theme.php:3706 #5 IPS\Theme\theme_nexus_front_clients_purchase in \system\Theme\Dev\Template.php:151 #4 IPS\Theme\Dev\Template:__call in \applications\nexus\modules\front\clients\purchases.php:140 #3 IPS\nexus\modules\front\clients\purchases:view in \system\Dispatcher\Controller.php:128 #2 IPS\Dispatcher\Controller:execute in \applications\nexus\modules\front\clients\purchases.php:100 #1 IPS\nexus\modules\front\clients\purchases:execute in \system\Dispatcher\Dispatcher.php:169 #0 IPS\Dispatcher:run in \index.php:16
  5. This is what I see when viewing a purchase info page in ACP: The invoices box needs some spacing from the custom fields box.
  6. I was testing an AccountSettings extension in my application and I disable it based on a specific value. Disabling it means I return NULL inside getTab() based on the value, however, if the URL is accessed directly the page throws an exception instead of a proper error: Whoops\Exception\ErrorException thrown with message "Undefined variable $output" Stacktrace: #5 Whoops\Exception\ErrorException in \applications\core\modules\front\system\settings.php:152 #4 Whoops\Run:handleError in \applications\core\modules\front\system\settings.php:152 #3 IPS\core\modules\front\system\settings:manage in \system\Dispatcher\Controller.php:139 #2 IPS\Dispatcher\Controller:execute in \applications\core\modules\front\system\settings.php:104 #1 IPS\core\modules\front\system\settings:execute in \system\Dispatcher\Dispatcher.php:169 #0 IPS\Dispatcher:run in \index.php:16 The code should return an error if the tab is not accessible. Additionally, I'd like you to add a new extension function so we can override it and define a custom error for our needs.
  7. As mentioned in the title, the class \IPS\Helpers\Menu\Link defines the $extraHtml variable but it's not used anywhere: public string $extraHtml = ''; I thought I could use it to add an image to my link, but the variable itself is only defined and not called/used anywhere (PHP or template).
  8. Trying to use the License Key API throws this exception: TypeError thrown with message "Api::error(): Argument #1 ($code) must be of type int, string given, called in \applications\nexus\interface\licenses\index.php on line 334" Stacktrace: #1 TypeError in \applications\nexus\interface\licenses\index.php:48 #0 Api:error in \applications\nexus\interface\licenses\index.php:334 This happens because the call to the error() function on line 332 has the code and message variables switched: catch ( ApiException $e ) { $api->error( $e->getMessage(), $e->getCode() ); } It must be changed to: $api->error( $e->getCode(), $e->getMessage() );
  9. Clicking on the + Create New button for a new product's Custom Field throws this exception: Whoops\Exception\ErrorException thrown with message "explode(): Passing null to parameter #2 ($string) of type string is deprecated" Stacktrace: #8 Whoops\Exception\ErrorException in \applications\nexus\sources\Package\CustomField.php:153 #7 explode in \applications\nexus\sources\Package\CustomField.php:153 #6 IPS\nexus\Package\CustomField:form in \system\Node\Controller.php:567 #5 IPS\Node\Controller:_addEditForm in \system\Node\Controller.php:464 #4 IPS\Node\Controller:form in \system\Dispatcher\Controller.php:128 #3 IPS\Dispatcher\Controller:execute in \system\Node\Controller.php:117 #2 IPS\Node\Controller:execute in \applications\nexus\modules\admin\store\fields.php:56 #1 IPS\nexus\modules\admin\store\fields:execute in \system\Dispatcher\Dispatcher.php:169 #0 IPS\Dispatcher:run in \admin\index.php:15 Based on Whoops debug code, the issue is that the $this->packages variable on line 153 is NULL: foreach ( array_filter( explode( ',', $this->packages ) ) as $id ) { try { $packages[] = Package::load( $id ); } catch ( OutOfRangeException ) { } } === P.S.: Merry Christmas! 🎅🎄🤶 I'll be posting a few more bugs as your gift! 😋
  10. The ACP page to manage moderator permissions is okay, but the one to manage administrator permissions needs some styling:
  11. One more thing I just noticed: the tooltip for the wrench icon (Mass Update Members) shows in the wrong position sometimes.
  12. Version 4.7.19: Version 5 Beta 9: While v4 is fast and reactive, the v5 tooltips are extremely slow and lag behind the cursor's position.
  13. Version 4 had a fixed size that fit 3 button controls regardless of how many were displayed: Version 5 pushes everything to the very right without a minimum width for the control buttons: I'm not sure if you'll accept this as a bug or call it feedback, but I prefer similar things (text + badges in this case) all aligned in the same column instead of being all over the place.
  14. It seems like a bug (unparsed language string), but I can't be sure. The Courses application is available only on the Cloud, so only IPS developers can answer what exactly is going on with that hash.
  15. Have a look at this guide:
  16. You can use the setting in ACP > System > SETTINGS > Login & Registration > Registration TAB > Minimum age required to register. 🤔
  17. Checkboxes have a bug that allows members to leave them empty even when required:
  18. Just to be sure, do you have a file named constants.php in your forum's root folder? If yes, does it contain a line like this? \define( 'CP_DIRECTORY', 'house' ); If it does, your folder is indeed renamed, so for the upgrade rather than /admin/upgrade you should go to /house/upgrade instead. If you don't have that line, I can't explain why the upgrader is looking for files inside the /house/ folder.
  19. Based on the screenshot you posted above your admin folder is renamed house. You won't get past that error unless you rename the admin folder to the same house name before uploading it. Or you can remove the constant to rename the admin folder in the constants.php file and use the default admin value. The option to rename the folder has been removed from v5, so you'll have to rename it back to admin in a future upgrade regardless.
  20. When any database table or column is missing, you'll get a warning in the ACP > Support page with a list of queries to automatically fix the issues. If you have nothing there, you're okay. 👍 You would need to proceed with a manual upgrade following these steps: Disable all applications/plugins in ACP (in case some are not compatible with PHP 8). Upload a fresh set of files downloaded from your client area (version 4.7.19 currently). Switch the PHP version to either 8.1 (recommended) or 8.0. Starting from version 4.7.4 PHP 7.x isn't supported anymore. Go to domain.com/admin/upgrade and follow the upgrade instructions. Once the upgrade is complete check in the ACP if any applications and plugins still work (enable them 1-by-1). You can also use the PHP8 Compatibility Scanner tool available in ACP > Support for further help. That "serviceworker" URL is actually not a task but a backend JS script that handles the push notifications for the browser, tablets, and phones. If any tasks are not running correctly, a big red warning will show up in your ACP to warn you about eventual issues (including the name of the task not working).
  21. Unfortunately, IPS never provides older versions for download, not even for a simple comparison. I have a folder with all versions myself, but I'm not allowed to share the package/files. 🤷‍♂️ A way to work around the sharing problem would be to hire someone with access to the 4.3.6 package and have them compare the files for you. Here are a few considerations: While the 2.x and 3.x versions used to require extensive file edits to install modifications, starting with version 4, there were no file edits at all. If you have third-party modifications installed (applications and/or plugins), they'll show up in your ACP. It is very rare for someone to edit the core/default files of the 4.x version. I recall that "serviceworker" file had some changes/fixes at some point, but I don't recall which version exactly. However, it might simply be a bug that's fixed in a later version. 🤔 Since you mentioned making a test copy, I would simply try upgrading that copy to the latest 4.7.19 version and see if the issue is fixed. The summary is: you most likely don't have any file edits.
  22. If a name changes the old URL won't work anymore and can't be redirected unless there's an unchanging value (the ID in this case). While it "can" be done, and I know some people have this setup in their custom apps, I doubt we'll ever see this supported in the default URLs.
  23. The function \IPS\Content\Widget::formElements() includes this check to skip the container field when no container class is set: /* Container */ if ( isset( $class::$containerNodeClass ) ) { $return['container'] = new \IPS\Helpers\Form\Node( 'widget_feed_container_' . $class::$title, isset( $this->configuration['widget_feed_container'] ) ? $this->configuration['widget_feed_container'] : 0, FALSE, array( 'class' => $class::$containerNodeClass, 'zeroVal' => 'all', 'permissionCheck' => 'view', 'multiple' => true, 'forceOwner' => false, 'clubs' => TRUE ) ); } The problem pops up when trying to save the widget configuration in the preConfig() function: public function preConfig( $values ) { $class = static::$class; if ( \is_array( $values[ 'widget_feed_container_' . $class::$title ] ) ) { $values['widget_feed_container'] = array_keys( $values[ 'widget_feed_container_' . $class::$title ] ); unset( $values[ 'widget_feed_container_' . $class::$title ] ); } The code checks if the container value is an array, but never checks if the value is available in the first place. Adding a simple isset() check solves the issue. Here's the full error: Whoops\Exception\ErrorException thrown with message "Undefined array key "widget_feed_container_XXXXXX"" Stacktrace: #7 Whoops\Exception\ErrorException in \system\Content\Widget.php:257 #6 Whoops\Run:handleError in \system\Content\Widget.php:257 #5 IPS\Content\_Widget:preConfig in \applications\CUSTOMAPP\widgets\itemFeed.php:101 #4 IPS\CUSTOMAPP\widgets\_itemFeed:preConfig in \applications\core\modules\front\system\widgets.php:224 #3 IPS\core\modules\front\system\_widgets:getConfiguration in \system\Dispatcher\Controller.php:107 #2 IPS\Dispatcher\_Controller:execute in \applications\core\modules\front\system\widgets.php:38 #1 IPS\core\modules\front\system\_widgets:execute in \system\Dispatcher\Dispatcher.php:153 #0 IPS\_Dispatcher:run in \init.php:947
  24. There is a modification for v4 if you're using v4.7.x: https://www.sosinvision.com.br/index.php?/file/40-profile-field-per-user-group/ Nothing yet for v5 if you're using the beta version.
×
×
  • Create New...