Developer Connection
Use this forum to interact with our development team on technical issues, suggestions and official best practices advice.
1,736 topics in this forum
-
- 1 follower
- 0 replies
- 348 views
Very small change, but it'd be nice if after installing an application, a method was called that redirects back to the application overview page (by default), but which we can override ourselves to replace with a redirect to our applications setup wizard or so on. Simple change but would offer a nice usability improvement for users by letting us take them right to the configuration page for our applications after installing.
Last reply by Makoto, -
- 1 follower
- 3 replies
- 416 views
Whenever writing apps that support reviews or comments, it seems like we're supposed to just copy and paste our own template for what is really the same core logic throughout most of the suite. Specifically, this is what I mean: Every application has their own reviews.phtml template. Is there a specific reason for this? Couldn't this be standardized to just use one base reviews template that third-party applications can then reference instead of having to do the same thing within our own apps? There's a lot of logic in these templates that could break between versions and this likely could mostly be avoided by just maintaining a single base template fo…
Last reply by bfarber, -
- 1 follower
- 6 replies
- 375 views
in mysql 8.0.17 the width attribute for integer data types and zerofill for numeric are ignored. this forces the schema checker to throw an error about difference between the schema and what is on the DB, can you guys place a version check in there that will skip this check for 8.0.17 so we can keep them for older mysql versions? my current dev is 8.0.17 and it would be a pita to have to rollback to an earlier version for something so minor, but it might drive a client who is running the support tool a bit insane with "errors with the database", as schema and db can't be resolved. support tool: DevCenter:
Last reply by CodingJungle, -
- 1 reply
- 283 views
I implemented \IPS\Content\Ratings on my app but the data added to core_ratings table isn't removed on app uninstall. Tks.
Last reply by bfarber, -
- 2 replies
- 900 views
I am trying to get the group name from the group id but everything I have tried has not worked. I am doing this in the html templates to display all secondary usergroups but I want to exclude some groups from displaying like the Adminitrators and Moderators group
Last reply by Walrusking, -
- 1 follower
- 4 replies
- 321 views
i know they aren't popular with a lot of dev's, but i absolutely love them. i have a few marketplace apps and a lot of custom apps that use them, but there are somethings that don't work with them well. clubs: if you have a node/subnode setup, with the items on the subnode not the parent node, clubs don't work. requires a bit of hookfu to get it to work. Copying: for what ever reason when copying a parent node in the ACP on a node controller, if the children are subnodes, it wont clone them, it wont even see it has any cause the hasChildren() check for the children check has the 'subnode' param set to false. there are other issues, but they might …
Last reply by CodingJungle, -
- 1 follower
- 5 replies
- 407 views
Hi, I wonder whether it would be possible from IPS to share their Blog Front Index template (https://invisioncommunity.com/news), so we can contribute together as clients and bring similar blog page created within Pages to the community. @bfarber was kind to share a piece of guides section there, would be nice to get the front page blog template too. The template could be provided AS-IS, we can adjust it for general use. Thanks.
Last reply by PatrickRQ, -
- 3 replies
- 334 views
Would sure be nice to have a way to where when clicking build application, especially if it's a new version, to have it run upgrade.php for the working version because otherwise it's more work testing to be sure that file's code goes smoothly. Otherwise all you can really do is either try executing the code from another place or have to go to another site to test upgrading OR uninstall the app on test site, reinstall old version, delete constants file, and run the upgrader.
Last reply by Midnight Modding, -
- 7 followers
- 36 replies
- 3.6k views
Hello, I am trying to build something similiar to your Developer docs. I am really stuck how and in what template I should create the navigation. 1. I have read your tutorials and it seems like I should create the navigation (including the 2 column layout) in my "categoryTable". And then I will load the articles using a javascript controller/ajax. Is that correct? 2. The categoryTable template gets the following attributes passed: $table, $headers, $rows, $quickSearch . I don't understand this line at all, but it apparently calls the recordRow template: {template="$table->rowsTemplate[1]" params="$table, $headers, $rows" object="$table->ro…
Last reply by PatrickRQ, -
- 1 follower
- 6 replies
- 415 views
I'm seeing a client utilizing my Gallery Enhancments plugin running into the following error, RuntimeException::0 IPS\File\_FileSystem->getImageDimensions() This is caused by the file not existing here, if ( ! file_exists( $file ) ) { throw new \RuntimeException; } ..and the reason the file doesn't exist, is because the client is using S3 storage, not the FileSystem. So.. why is IPS making a call to \IPS\File\FileSystem, not \IPS\File\Amazon? Code in question: https://github.com/FujiMakoto/ips-gallery-enhancements/blob/master/hooks/GalleryImage.php#L40 This should be pulling from Amazon using the base getImageDimensions method…
Last reply by Makoto, -
- 1 follower
- 1 reply
- 311 views
I noticed this when i went to go edit an existing nexus package on my dev site, it doesn't happen when i switch to php 7.3, so i'm pretty sure it is something in 7.4 object(Whoops\Exception\ErrorException)#342 (8) { ["message":protected]=> string(51) "Trying to access array offset on value of type null" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(8) ["file":protected]=> string(81) "/home/michael/public_html/dev/applications/nexus/sources/Form/DiscountLoyalty.php" ["line":protected]=> int(36) ["trace":"Exception":private]=> array(10) { [0]=> array(5) { ["file"]=> string(81) "…
Last reply by bfarber, -
- 1 follower
- 3 replies
- 448 views
In system/Content/Search/Elastic/Index.php::resetLastComment() you have this code on lines 877-884: $where = NULL; if( $ignoreId !== NULL ) { $commentClass = $itemClass::$commentClass; $commentIdColumn = $commentClass::$databaseColumnId; $where = array( $commentClass::$databaseTable . '.' . $commentClass::$databasePrefix . $commentIdColumn . '<>?', $ignoreId ); } The problem is that one of my custom applications does not implement the \IPS\Content\Comment but only \IPS\Content\Review. The code above clearly doesn't check if the comments class is available before trying to load/use it. And the fix here is not to si…
Last reply by bfarber, -
- 1 reply
- 289 views
Newly created fields (either added to existing DB's or when adding them to newly created DB's) are crashing out after the form is saved/record created while IN_DEV. There is an unset $embeds var in the notifications routine. Older databases/fields are fine in or out of dev, it's just newly created fields that are hitched on this, and only while IN_DEV. Everything is working fine when you are out of IN_DEV so this is a bit of an edge case, albeit an annoying one. No idea when this particular bug arose, might have been earlier than 4.4.10
Last reply by bfarber, -
- 13 replies
- 640 views
Althought it's in the template: <span class="ipsDataItem_generic"> {{if \in_array( $userAgent->browser, array( 'Android Browser', 'AppleWebKit', 'Camino', 'Chrome', 'Edge', 'Firefox', 'IEMobile', 'Midori', 'MSIE', 'Opera', 'Puffin', 'Safari', 'SamsungBrowser', 'Silk', 'UCBrowser', 'Vivaldi' ) )}} {{$browser = str_replace( ' ', '', $userAgent->browser );}} <img src="{resource="logos/browsers/{$browser}.png" location="interface"}" width="24"> {{endif}} {$userAgent->browser} {$userAgent->browserVersion} </span> it doesn't show: The image exists is in the right folder: applications/core/in…
Last reply by Adriano Faria, -
- 1 follower
- 2 replies
- 350 views
So, here's why I couldn't edit one of my file submissions recently: I just tried submitting a topic here with a video attachment embedded and got this: It won't let me submit the post and just returns an "INVALID_URL" error every time until I delete the uploaded video. Apparently this didn't impact Daniel when he tried to edit my post himself? So seems to be an issue specific to my member group possibly.
Last reply by bfarber, -
- 1 follower
- 1 reply
- 305 views
When adjusting the setting to create a topic when a file is submitted in IP.Downloads, there's no validation check to ensure the user has actually selected a forum (which is required), so it throws an exception here instead. https://imgur.com/WuJFCjb vObYcdQ4Nb.mp4
Last reply by bfarber, -
- 2 followers
- 11 replies
- 561 views
Demonstration: Original link: http://slack.taiga.sh/badge.svg The reason this fails is because \IPS\Image cannot validate SVG images. The current method you are using attempts to validate images using hex signatures, $signatures = array( 'gif' => array( '47' . '49' . '46' . '38' . '37' . '61', '47' . '49' . '46' . '38' . '39' . '61' ), 'jpeg' => array( 'ff' . 'd8' . 'ff' ), 'png' => array( '89' . '50' . '4e' . '47' . '0d' . '0a' . '1a' . '0a' ) ); However, considering SVG is just XML and.. as far as I can tell, really has no solid standard you can reference for validation, I'm not sure how you…
Last reply by Makoto, -
- 1 follower
- 2 replies
- 552 views
One of the new third-party standards is that we should not be manipulating core IPS tables (with exception to group settings still I believe). Which I think is absolutely fine and reasonable. It's not terribly difficult to utilize joins to add in custom columns where we need them. What is currently hard, however, is ensuring our custom columns are actually selected. Take, for example, the following hook I have written, //<?php /* To prevent PHP errors (extending class does not exist) revealing path */ if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) ) { exit; } class radtags_hook_C_DownloadsCategory extends _HOOK_CLASS_ { /** * Our custom data tab…
Last reply by Makoto, -
- 1 follower
- 2 replies
- 297 views
Simple suggestion to make third-party stuff a bit more neat. I may want to add a header to separate my content when inserting form elements like so, /** * Add Input * * @param \IPS\Helpers\Form\FormAbstract $input Form element to add * @param string|NULL $after The key of element to insert after * @param string|NULL $tab The tab to insert onto * @return void */ public function add( $input, $after=NULL, $tab=NULL ) But addHeader does not support $after and $tab as arguments at the moment, /** * Add Header * * @param string $lang Language key * @return void */ public function addHeader( $lang ) Very minor, but would…
Last reply by Makoto, -
- 2 followers
- 2 replies
- 340 views
Whoops\Exception\ErrorException thrown with message "Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`" Stacktrace: #10 Whoops\Exception\ErrorException in /home/michael/public_html/dev/system/Node/Controller.php:969 #9 Whoops\Run:handleError in /home/michael/public_html/dev/init.php:653 #8 require_once in /home/michael/public_html/dev/init.php:653 #7 IPS\IPS:autoloader in [internal]:0 #6 spl_autoload_call in /home/michael/public_html/dev/applications/core/modules/admin/applications/applications.php:23 #5 require_once in /home/michael/public_html/dev/init.php:653 #4 IPS\IPS:autoloader in [internal]:0 #3 spl_autolo…
Last reply by CodingJungle, -
- 1 follower
- 3 replies
- 352 views
Hi, applications/forums/Application.php, method convertLegacyParameters. 1) Page-parameter is not converted properly, incorrect function-call. 2) This is a bit more involved. Before the upgrade, a link to a specific post could look like this: https://example.com/index.php?showtopic=1706933&page=607#entry25148242 However, after it's been through the post conversion (3.4 -> 4.4), the link in the post looks like this instead: https://example.com/index.php?showtopic=1706933&page=607&do=findComment&comment=25148242 And that link only takes you to the topic (and the page given, if the first bug is fixed). So my suggested…
Last reply by Daniel F, -
- 1 follower
- 2 replies
- 333 views
Hi, In applications/core/modules/admin/languages/languages.php you have two calls like this (line 305) foreach ( array( 'vle_editor', 'vle_keys' ) as $k ) { if ( $values[ 'lang_' . $k ] ) { \IPS\Request::i()->setcookie( $k, 1 ); } elseif ( isset( \IPS\Request::i()->cookie[ $k ] ) ) { \IPS\Request::i()->setcookie( $k, 0 ); } } Unless I'm missing something, it should be \IPS\Request::i()->setCookie with a big C instead of a small one.
Last reply by TSP, -
- 8 replies
- 422 views
I want to display a custom message based on a database condition after success of registration, Where I can do this? Requirements: If user coming from a specific url of website and complete the registration then user must have seen a custom message. Ex- You are now eligible for XXXXXXXX. Please help me
Last reply by bfarber, -
- 1 follower
- 1 reply
- 282 views
I stumbled upon this. In applications/forums/sources/Topic.php on line 1861: $comments[ $_hash ] = $this->_comments( $class, $limit ?: static::getCommentsPerPage(), $offset, ( isset( $class::$databaseColumnMap[ $order ] ) ? ( $class::$databasePrefix . $class::$databaseColumnMap[ $order ] ) : $order ) . ' ' . $orderDirection, $member, $includeHiddenComments, $cutoff, $includeWarnings, $extraWhereClause, $includeDeleted, $includeWarnings ); You pass on $includeWarnings twice. You send 11 parameters, but the function _comments in system/Content/Item.php "only" takes 10. (As a sidenote: I spent far too much time debugging an issue I had, which ended up …
Last reply by bfarber, -
- 1 follower
- 3 replies
- 379 views
Probably an issue with other comment classes, but I've only tested with \IPS\forums\Topic\Post. The behaviour on loadFromUrl doesn't produce an expected result. Let's say you installed the following code in the root folder of this community: <?php require_once( __DIR__ . '/init.php' ); $url = \IPS\Http\Url::createFromString( 'https://invisioncommunity.com/forums/topic/444948-cache-page-output-for-guests/?do=findComment&comment=2809267' ); $post = \IPS\forums\Topic\Post::loadFromUrl($url); echo "Loaded postId {$post->pid}: {$post->url()}"; What I would expect: It should load the post with postId 2809267. Alternatively fail if it's unable to …
Last reply by TSP,