Developer Connection
Use this forum to interact with our development team on technical issues, suggestions and official best practices advice.
1,678 topics in this forum
-
- 2 followers
- 4 replies
- 351 views
Troubleshooting a script to create records and running into an exception. Calling via API: POST /cms/records/{database_id} Returns: {'errorCode': '1S306/E', 'errorMessage': 'UPLOAD_FIELD_NOT_OBJECT'} Does this error apply to the image object (Record Image)? I only have one other multi-image upload field in the fields object that is optional and I'm not sending it in the POST request at all for my test, so I'm assuming this error is being returned from the image field, but want to confirm before I go down a rabbit hole. P.S. My script is written in Python, not PHP.
Last reply by Clover13, -
-
- 2 followers
- 5 replies
- 596 views
We're experiencing an issue with moderators with only file permissions granted being unable to see pending versions in the approval queue. I looked into this and there's a check in ./applications/downloads/extensions/core/ContentRouter/Files.php:49 where PendingVersion is only inserted where \IPS\downloads\File::modPermission( 'unhide', $member ) is true. However, since no container is provided, this will only return true if the user has global content unhide permission.
Last reply by Marc Stridgen, -
-
- 2 followers
- 2 replies
- 391 views
Hi folks, Is there a provided method already in IPS4 to obtain the file type or extension of an uploaded image attachment resource, or do we have to do it manually in theme templates? If I know what an image file type is already because I supplied it I can use this: href="{resource="my.webp" app="core" location="front"}" type="image/webp" but if a user uploads their image, I need to set the correct image type from the resource itself. Many thanks!
Last reply by The Old Man, -
- 1 follower
- 3 replies
- 373 views
Hello, I want to create a small application to validate some invitation codes, for customers, in the registration form. But I don't know how to link the form field of my application to the registration form. If you could give me some advice or hints, I would be very grateful. Best regards and Merry Christmas to all
Last reply by bernhara, -
-
- 1 follower
- 3 replies
- 474 views
Please keep the extension's behavior consistent across all the functions. Some extensions first check if the extension implements a certain function before calling it, while others expect the function to exist at all times and throw errors if they're missing. For example, the core/ModeratorPermissions currently has 4 functions available (preSave, getPermissions, onChange, onDelete) but only preSave checks if the function is available before calling it: /* Allow extensions an opportunity to inspect the values and make adjustments */ foreach ( \IPS\Application::allExtensions( 'core', 'ModeratorPermissions', FALSE ) as $k => $ext ) { if( method_exists( $ex…
Last reply by teraßyte, -
-
- 1 follower
- 1 reply
- 554 views
Using the Form helper there's an option (the 4th one) to pass additional attributes as an array. Passing a single attribute is okay, but if you pass multiple ones the attributes are all attached with no space separating them. The fix is to edit the template "\applications\core\dev\html\admin\forms\template.phtml" on line 2: <form accept-charset='utf-8' data-formId="{$id}" action="{$action}" method="post" {{if $uploadField}}enctype="multipart/form-data"{{endif}} data-ipsForm class="{$formClass}" {{foreach $attributes as $k => $v}}{$k}="{$v}"{{endforeach}} {{if \count($tabArray) > 1}}novalidate="true"{{endif}}> You need to add a space inside th…
Last reply by teraßyte, -
- 1 follower
- 3 replies
- 347 views
I couldn't find anything in the docs, but I want to apply some different code in template logic for desktops, tablets and phones. We can use media queries in CSS to make styling relevant for certain device screen widths and we have ipsResponsive_showPhone etc. However, is there a utility available to do the same for HTML in IPS' template logic, perhaps a PHP expression or something? Something like: {{ is small-device/phone? }} this code {{elseif is medium-device/tablet? }} this code {{else}} use this for everything else {{endif}} Many thanks!
Last reply by The Old Man, -
- 1 follower
- 3 replies
- 424 views
Need to display different icons in my header whether someone is logged in or not. Any tips on HTML code that one could use?
Last reply by Adriano Faria, -
-
- 2 followers
- 24 replies
- 519 views
Hi, According to this help guide and an existing setting in the AdminCP https://invisioncommunity.com/4guides/themes-and-customizations/advanced-theming/managing-theme-settings-r128/ <?php return \IPS\Settings::i()->bot_antispam_type === 'recaptcha2'; This would return true for use in a conditional theme setting so that a setting will be shown or not, but when I try this using my own custom theme setting: <?php return \IPS\Theme::i()->my_theme_setting == true; it gives me an error: Error: Undefined constant "my_theme_setting" (0) #0 C:\laragon\htdocs\ips4-dev-theme3\system\Theme\Theme.php(1818): eval() #1 C:\laragon\htdocs\ips4-dev-t…
Last reply by The Old Man, -
-
-
- 2 followers
- 2 replies
- 343 views
Hi team, I think I may have found a bug in Commerce, where the cost to upgrade a package is calculated. In \IPS\nexus\Package->costToUpgrade(), at line 3334: try { $currency = $purchase->original_invoice->currency; } catch ( \Exception $e ) { $currency = $purchase->member->defaultCurrency(); } The $currency used for the calculation is either the purchase original currency, or the member default currency. But then, at line 3423, a difference is calculated: $diff = $purchase->renewals->diff( $renewalTermToUse ); And if the $currency calculated above is different from the current package currency, this difference throw…
Last reply by Marc Stridgen, -
-
- 1 follower
- 1 reply
- 432 views
Just want to double check something, and happy to be wrong on this... Is there a reason why uninstalling an Invision application doesn't remove that specific application's javascript from the core_javascript table of the database? It's easy to check: Install a new instance of the full suite Check core_javascript and there's all the javascript files for all the applications. Uninstall a random application (say, Blog) Check core_javascript and there's all the javascript files still there for that specific application. Reason I am asking is that I've just spotted that an old test instance of mine where I had uninstalled all my own ap…
Last reply by Nathan Explosion, -
-
- 2 followers
- 1 reply
- 236 views
Hi team, The bug mentioned in my first post has been corrected, thank you. However, I realize that there's another bug in the same part of the code: In \IPS\nexus\Package, at line 3579: if( !$diff->invert and $diff->days > 0 ) { $purchase->expire = $purchase->start->add( $diff ); } The problem is that the above code adds the $diff difference to the purchase date, which is incorrect. Let's take an example: Today is December 7, 2023. The purchase date is November 12, 2023. The initial term is 1 month. We therefore have : $initial = new \DateInterval( "P{$newPackage->initial_term}" ) = 1 month $diff …
Last reply by Marc Stridgen, -
-
- 1 follower
- 2 replies
- 338 views
Anyone knows where this counter is stored in the database? With the Marketplace being removed and the plugins not having an update URL, this notification would stay there forever. I already cleared the update data in the plugins table, but the counter seems to be stored somewhere else.
Last reply by opentype, -
-
- 7 replies
- 427 views
I have an application that creates a custom commerce package, extending \IPS\nexus\Invoice\Item\Charge. Up until the latest update it worked fine, but since the latest update the ItemsIterator expects all extensions to be in the 'nexus' application, and therefore cannot load the class of my package object. How it works now, I don't think its possible any more to create custom chargable items, but I desperately need this functionality.
Last reply by Callum MacGregor, -
-
-
- 1 follower
- 1 reply
- 348 views
Hi IPS, FYI there have been 6 updates to Howler.js since v2.1.2 (from April 2019) in IPS 4.7.14. Current release is v2.2.4 (Sep 2023). Please consider bringing it up to date. 🙂 Also FYI: Many thanks. Graham
Last reply by Stuart Silvester, -
-
-
- 2 followers
- 5 replies
- 456 views
Clarifying what some tasks do, the desire to rename the task file / class is really needed. That said, when updating an existing installation of the application, the originally named task still exists in the applications task folder. It is also present when viewing all tasks, because it's sticking around in the core_tasks table. Running this query on upgrade appears to fail. Am I missing something? Double check the query syntax for me. \IPS\Db::i()->delete( 'core_tasks', array ('key=? AND app=?','steamCleanup','steam') )
Last reply by Aiwa, -
-
I have upgraded site on subdomain, Now i want to move those files on root of the site. and there will be change in the URL of the site. Will this work or i have to perform the upgrade again? Please guide
Last reply by Marc Stridgen, -
- 0 replies
- 335 views
I want to extend /global/forms/uploads and add a button so I can launch a form that will gather some information from the user, pass that to the OpenAI image endpoint and return an avatar image. I would then want to set this image as their profile picture. Before I get started I want to know if it's possible for a custom plugin to do this. I know that the stock photos extension works by opening a form, browsing for pictures and then selecting one. Am I likely to encounter any limitations with this approach? Any advice would be most appreciated, thanks.
Last reply by Mick23, -
-
- 2 followers
- 7 replies
- 605 views
Chrome offer a convenient "Dowload" Button in its native HTML5 video player's context menu, that I want to be disabled. (Sorry, german screenshot. The marked button means "Download"). This button can be disabled by adding the following HTML attribute to the video tag: controlsList="nodownload" In AdminCP theme editing there is a template file wich looks exactly like the embedded video player code: Unfortunately making any changes there will not apply to the actual embedded video player code. So this must be generated from another part of the Invision application. I'd appreciate any help on how to get that controlsList="nodownload" …
Last reply by Nathan Explosion, -
-
-
- 1 follower
- 2 replies
- 381 views
I trying to figure out what would be the best way of using the rest api: 1. upload images to pages media when adding a database record 2. imbed this images within the content of the database record. I can certainly do this manually using the 'Insert Image from URL' feature, but I don't see anything in the api documentation about doing this using the api. Also I am not sure about embedding part. Would i just insert image url between the paragraphs and headings? If it is not possible to use the api to upload the image then I could upload them to a subdomain. But how can I then insert the images into the content so the image tag is properly formatted…
Last reply by virap1, -
-
-
- 3 followers
- 12 replies
- 756 views
One feature of my site is that there is limited free access to anybody who wishes to have it, but for unlimited access there is an annual subscription payable. For the "free" users (including guests), the tradeoff is that they are served adverts. I would like to ensure that the JavaScript file(s) that are loaded for the adverts are not even in the output HTML code for paid subscribers. For example: {{some template code to say "if user is not in Administrators, Moderators or Paid Subscribers groups, output this line"}} <script type="text/javascript" src="/some/path/to.js"></script> {{endif}} How would I achieve this?
Last reply by Ryan Ashbrook, -
-
-
- 1 follower
- 5 replies
- 448 views
Hi all, In the process of upgrade I am getting below error. Can any one please suggest something or should I continue anyway?
Last reply by Jyoti Rani, -
-
-
- 2 followers
- 9 replies
- 546 views
I have noticed that the IPS system is missing very important information and option whenever you set the Standard login "Authentication Type" to "Email Address" only. There's no option in case a member forgot his email address, and this is very import point especially IPS will be removing Display name login in v5. But still this option is needed in v4 whenever the community set to email address only to login. Perhaps force members to add security questions / answers in order to view their email address.
Last reply by Marc Stridgen, -
-
-
- 2 followers
- 4 replies
- 636 views
Last reply by Marc Stridgen, -
-
While I was looking into changing the number of comments per page for database records (see this link) I found out that IPS actually already allows to control it. The problem is that the number is tied to the setting that also controls the number of records shown per page. The setting I'm talking about is "Field Options > Records per page" when editing a database settings. The name implies it controls the number of records, but at the same time it controls also the number of comments: /** * Set custom posts per page setting * * @return int */ public static function getCommentsPerPage() { if ( ! empty( \IPS\cms\Databases\Dispatcher::i()->recordId…
Last reply by Marc Stridgen,