Developer Connection
Use this forum to interact with our development team on technical issues, suggestions and official best practices advice.
1,679 topics in this forum
-
- 2 replies
- 517 views
I'm trying to make an external request using \IPS\Http\Url::external($somepath)->request()->setHeaders( array('Content-Type' => 'application/json') )->post( array()); So I can set the body and the headers. But How do I set the authorization? So either CURLOPT_USERPWD or a token?
Last reply by Ryan Ashbrook, -
- 1 follower
- 6 replies
- 629 views
Hello, I have been trying to figure out how to add my own parts of the API for an application I'm working on. I have tried doing research to find out how to do this and I've been searching for probably an hour and feel dumb if there is something on how to do this. But a lot of the docs / examples for developers is minimal or not documented (at least looking at the docs for what I want to do). I've tried looking at the core applications of IPS4 and recreating the way APIs are created in that application or even using a code hook. I can't seem to get it to work properly. I have gotten to a point where it registers the API request but when trying to access it I get the err…
Last reply by bfarber, -
- 1 reply
- 312 views
It's great that we can set up our own logging with \IPS\Log::log(). How can I log an error to the Error Logs instead of System logs? The trouble I have right now with \IPS\Log::log() is that it has no level of severity. So I cannot distinguish between warnings, errors, critical errors... I have noticed that errors that appear in the Error Logs trigger a notification in the ACP. So right now I see System Logs as a place for warnings and Error Logs as a place for critical errors that require more attention. I don't think this is ideal though. It would be nice if we could set a severity level with our logs. And depending on the severity, a notification co…
Last reply by Ryan Ashbrook, -
- 1 follower
- 1 reply
- 305 views
Hi, There is not any guide about custom payment gateway, could you please advise best way to develop a custom payment gateway? Should it be a hook or an application?
Last reply by bfarber, -
- 1 follower
- 3 replies
- 295 views
There's an issue with the Db table helper where if your table has filters that can return zero results, it will return an error on ajax requests due to an underflow exception and does not change the table results at all (while the correct behavior is to indicate there are no results). I attached a patch that resolves this issue by running a try/catch statement before iterating over the select results. DbEmptyFilter.patch Let me know if you need me to elaborate on the issue/fix.
Last reply by bfarber, -
- 1 reply
- 280 views
I'm creating a plugin to hook into a function to add some extra functionality. class hook100 extends _HOOK_CLASS_ { protected function someFunc() { $return = parent::clear(); // my code return $return; } } The problem is that when parent::clear(); runs it contains a bunch of \IPS\Output::i()->redirect() Meaning that my code never gets executed as the page leaves before then. Does anyone have any advice how to handle situations like this?
Last reply by bfarber, -
- 2 followers
- 4 replies
- 282 views
Hi, I'm making a plug-in with a code hook in Dev mode on my local Xampp. I read that you shouldn't replicate the source code but the Development documentation doesn't actually go on to provide any explanation on how to otherwise insert our code into the existing functions within a method. If you have several existing IPS functions mixed with chunks of PHP within a method, within a class, inside a system/file/file.php, and you want to extend them or insert additional code, what is the recommended way to do it, please? I may not be describing it correctly so I'm picturing this as an example of what I want to hook into... class xxx extends xxxxxxxx ... m…
Last reply by The Old Man, -
- 2 replies
- 308 views
When using this method: \IPS\Db::i()->select(); The table name you pass automatically gets the sql_table_prefix value defined in conf_global.php prepended to it. Is there a way to avoid this? I wish to access a table I have created that does not have this prefix added.
Last reply by Tom S., -
- 1 follower
- 6 replies
- 1.1k views
Please don't forget that marketplace submissions should be completely installable and uninstallable via the ACP, which means that they shouldn't include any additional files which need to be uploaded to the clients webspace manually. Applications can ship the custom js,image,font etc.. files within the interface folder and themes can utilize the theme resource system to add custom files ( JS, Font, Video, etc..).
Last reply by MIXOH, -
- 2 followers
- 3 replies
- 296 views
Hello, As I understand it, I can extend a class using code hooks in plugins. So, if I wanted to modify a method for the cart class I could do this inside of my plugin: class cart extends _HOOK_CLASS_ { protected function clear() { // some code } } Am I right in thinking I will completely override the clear() method with that? My question is how can I add some extra functionality to the clear() method without completely overriding it? Say, for example, I wanted to add an extra line to that method making a change to a table in the database (but keep the rest of the functionality the same). How could I do that? I read that just copying the entire …
Last reply by Tom S., -
- 2 followers
- 3 replies
- 206 views
I'm not really sure if you want to consider this a bug or not, but when submitting support requests, the e-mails are not validated against the list of banned e-mails (as they are not technically passed as "account emails" and thus do not go through those checks") This was brought to my attention by a client here: https://dev.taiga.sh/ips/Indisposable/issues/4
Last reply by KT Walrus, -
- 1 follower
- 1 reply
- 188 views
When creating a new IncommingEmail extension in development mode, you get the following error screen: The extension is still created and the error screen is temporary, just an issue parsing the example extension since it doesn't parse properly. (Was told by @Rhett to submit bug reports here and just reference ticket #1032985 if needed)
Last reply by Daniel F, -
- 1 reply
- 228 views
Hi, When implicating a new OAuth 2.0 based login handler, I get some problems, as tokenEndpoint returns string not json data. For example, in Facebook GET https://graph.facebook.com/v3.2/oauth/access_token? client_id={app-id} &redirect_uri={redirect-uri} &client_secret={app-secret} &code={code-parameter} will return { "access_token": {access-token}, "token_type": {type}, "expires_in": {seconds-til-expiration} } But in this case, it returns access_token={access-token}&token_type={type}&expires_in={seconds-til-expiration} I have no idea how to support this handler, could anyone help?
Last reply by bfarber, -
- 1 follower
- 2 replies
- 193 views
Hi there, Small question 🙂 In the followed items section (URL /followed), we have the list of the followed items. However, when a Content Item is followable (is subclass of \IPS\Content\Followable), this followed items section automatically display the Node the Content Item belongs to, in the left menu of the page. This is because of the following code, in /core/modules/front/system/followed.php, line 47: if ( isset( $class::$containerNodeClass ) ) { $types[ $class::$application . '_' . $class::$module ][ mb_strtolower( str_replace( '\\', '_', mb_substr( $class::$containerNodeClass, 4 ) ) ) ] = $class::$containerNodeClass; } It means tha…
Last reply by LaCollision, -
- 2 followers
- 3 replies
- 205 views
Hi, In my app, I've created Content Items that don't have a container (it's something possible, like the Status updates that don't belong to a container). My Content Items are followable, so they implement IPS\Content\Followable. However, I'm facing a bug with the "followed" section, available at the address "/followed". In the file core/modules/front/system/followed.php, at line 96, there is a call to a new \IPS\core\Followed\Table(). And in this object, the construct() method calls the $className::$containerNodeClass property… which fires an exception 😭 => Could it be possible, in this constructor, to check the presence of the $co…
Last reply by LaCollision, -
- 1 follower
- 2 replies
- 229 views
Hi, In the 4.4.1 third-party developers notes, there is this info: … however, I can't see what changes have been made to the FileStorage skeleton. Do you know what has been changed? Thank you!
Last reply by Martin A., -
- 2 followers
- 1 reply
- 219 views
I am not sure why this happens, as it only appears to happen to mac users and i am not even sure if it happens to other developers. however i get a PM once or twice a week from mac user that goes to extract the zip of my apps, and it will extract the contents of the tar file inside the zip as well. so they end up without having a "tar". It made sense in 3.x to zip up the apps, but it doesn't really make that much sense here. most of the time, i just include a "how to install" text with the zips, and even then it is usually just "this installs just like any other IPS app, no additional requirements". I would much rather there be a section, like for support info,…
Last reply by Stuart Silvester, -
- 2 replies
- 264 views
I'm building a new plugin with a setup install.php script. I cannot find any documentation regarding how to run my install.php script to verify it's working.
Last reply by Dave Macaulay, -
- 1 follower
- 7 replies
- 291 views
I'm testing a couple of plugins in 4.3.0 and the members fields shows up like that: This is the field. $form->add( new \IPS\Helpers\Form\Member( 'followers_member', NULL, FALSE ) ); If I set it to be required, it shows "open". I believe this is happening due to the changes made on TAGs, which uses same classes somehow (JS, etc). Obviously this is not the intended behaviour for the MEMBER field as my field cannot be required. Can you confirm this is right or wrong? I mean, it will be this way now? Testing a bit more, it seems that it had some change. I mean, even I choose GROUP above and submit the form, it won't stop even MEMBER being re…
Last reply by bfarber, -
- 2 replies
- 328 views
Widget skeleton still shows up in the previous format: public function configuration( &$form=null ) { if ( $form === null ) { $form = new \IPS\Helpers\Form; }
Last reply by Adriano Faria, -
- 2 replies
- 238 views
Hello! After update to 4.4.0 my custom product type in no longer avaliable. Although the file is still here /applications/nexus/sources/Package And file is still extend Package namespace IPS\nexus\Package; /* To prevent PHP errors (extending class does not exist) revealing path */ if (!defined('\IPS\SUITE_UNIQUE_KEY')) { header((isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0') . ' 403 Forbidden'); exit; } /** * Product Package */ class _Selfitem extends \IPS\nexus\Package { How to make it available again?
Last reply by goldmorphin, -
- 5 replies
- 217 views
When updating a member record ($member) for something important, such as $member->name or $member->member_group_id, am I overlooking anything additional I should do, such as updating any particular cache, logging, or anything else? I see in my 3.x code there was a built in IPS method for updating the member's name, but I don't see anything like that in 4.x. Also, in 3.x I was working around display name changes per x amount of time in the group settings, which needed to just be ignored, so I assume now I could just ignore that, as I don't see anything in function save() that would stop the name change, ie if there is still a limit, it must get checked by u…
Last reply by Midnight Modding, -
- 1 reply
- 201 views
Good Morning, I'm developing a custom login handler using OneLogin's PHP SAML library. The way that saml works is the user clicks a button to login -> redirected to the login page -> login page realizes user needs to login, builds a SAML request and redirects to the Identity Provider (IDP) -> User Logs in -> User is redirected back to an "assertion consumer" page which consumes either HTTP POST or GET XML containing the login information. I have the button handler setup and the login redirect is working thanks to the documentation Invision provides. My question is how do I create a custom Assertion Consumer URL (Example: https://mysite.com/Asse…
Last reply by bfarber, -
- 1 follower
- 2 replies
- 291 views
Hi, I have a question about this 4.4 developer change: I assumed this would allow third-party developers to store files for custom share services, payment gateways, license keys, etc. within their own application directory, and not require the user to upload them into specific locations anymore. Which would be a very welcome change 🙂 However, this doesn't actually work. The code still loads all these classes from hard-coded directories. For example, Commerce loads gateways with: $classname = 'IPS\nexus\Gateway\\' . $data['m_gateway']; Meaning that in practice, we still need to upload our custom gateways to /applications/nexus/sources/Gateway/ folder f…
Last reply by Daniel F, -
- 5 replies
- 429 views
Hello, I'm using: {{if request.module == 'forums' && request.controller == 'topic'}} {{$topic = \IPS\forums\Topic::loadAndCheckPerms( \IPS\Request::i()->id );}} {{$forumid = $topic->container()->id;}} forum-{$forumid} {{endif}} in globalTemplate to get the forum ID for styling purposes. It does its job, however, if users view topics they lack access to, they're presented with a: [[Template core/front/global/globalTemplate is throwing an error. This theme may be out of date. Run the support tool in the AdminCP to restore the default theme.]] which logs as a template error: OutOfRangeException::0
Last reply by bfarber,