Developer Connection
Use this forum to interact with our development team on technical issues, suggestions and official best practices advice.
1,734 topics in this forum
-
- 1 follower
- 1 reply
- 495 views
In my plugin I define a settings like so : I then proceed to have my settings.php file have these contents: $form->add(new \IPS\Helpers\Form\TextArea('disable_multiple_quantities_names', \IPS\Settings::i()->disable_multiple_quantities_names, null, array())); if ($values = $form->values()) { $form->saveAsSettings(); return true; } return $form; Going to the settings section of the plugin, I get this as expected (Disregard the plugin name, its for testing) : Putting in a value and pressing save, I get this: Edit : Creating a new plugin and redoing everything fixed…
Last reply by bfarber, -
- 2 followers
- 19 replies
- 603 views
@Mark I'm wondering if the implementation of this can be revisited. I've found that when using this method in combination with other where conditions, your where clause breaks - unless the IN clause is placed LAST. For example, if I do something like this: $where[] = \IPS\Db::i()->in( 'category_id', $categories ); $where[] = array( 'member_id=?', $memberId ); The IN is included but the remaining clauses are ignored. However, if I simply reverse the order $where[] = array( 'member_id=?', $memberId ); $where[] = \IPS\Db::i()->in( 'category_id', $categories ); That works correctly. Most of the time you can rearrange the code to make this wo…
Last reply by Midnight Modding, -
- 2 replies
- 316 views
Hi, i am going to migrate a community site based on a proprietary custom software solution to Invision. The data i would like to migrate are: users user profiles forum kategories and posts personal private messages between individual users I am not sure what's the best way to start migration: should i have a look at the converters available and adopt one of them for my own needs or wouldn't it be better to directly write the data to the database by executing custom sql statements. As this really is a custom solution for a one-time migration, i wonder if it wouldn't be overkill to follow the architecture of the available converters, however…
Last reply by sinix, -
- 1 follower
- 9 replies
- 389 views
Good day I want to develop a plugin to add a captcha to the forum authorization form. I can not understand how to do it correctly. As far as I understand, you just need to add to the generation of a login form or an e-mail account and password: -> add (new \ IPS \ Helpers \ Form \ Captcha); Help! Tell me how to do it right?
Last reply by DawPi, -
- 1 follower
- 1 reply
- 281 views
As per title. The code box does not have support for JSON specifically. Is it possible to add it? Well, right after posting I figured out that selecting Javascript does support it. Instead of "adding support for it", can you change the language string to list it after the name with parenthesis? Kinda like you do already for C Language. And related to the code box, I am actually wondering why every time I open it I get that loading image for a while before I can finally use it. Is there any need for it when loading an empty code box?
Last reply by bfarber, -
- 3 replies
- 397 views
A while back I added like 20 or 30 rows to a table via a for loop. I just looked in the db and noticed SOME of them don't have their friendly titles stored! They're all in the same table, all were created at the same time via the same for loop, all of them have their titles stored, yet around 5 or 10 do not have the friendly version saved! What in the world??? And all of the titles were generated automatically such as dummy1, dummy2, dummy3, etc... so I can think of no reason at all why this would be happening.
Last reply by Midnight Modding, -
- 0 replies
- 275 views
On the same page I have several Table\Db tables. I need to know the count of rows in each one in the template I am showing "all" of them in. What is a good way of going about this, without wasting a duplicate query that would already be used in getRows()? (actually I don't need to know the exact count, I just need to know yes or no does it have at least 1 row in it) If it were just one table, easy.... in that one table's template check count( $rows ). But when each table has its own template and I need to know the counts in the master template... I'm drawing a blank. What I had been doing is checking if( trim( $table ) ) for each table in the template, but that …
Last reply by Midnight Modding, -
- 1 follower
- 34 replies
- 844 views
What's the deal with a form not working in the acp, due to a db exception saying "no default value" for a text column, then in db schema we can't even "put" a default value for a text column? Even changing it to allow null doesn't change default to null.
Last reply by Midnight Modding, -
- 4 followers
- 8 replies
- 458 views
I noticed that in 4.3, Codepen was removed from \IPS\Text\Parser::_oembedServices. Was this intentional? And if so, can you please provide the reason? I have a client that uses codepen extensively, so if there was a valid reason for its removal, I'd like to know so that I can be aware of the "consequences" of putting it back in. Thanks.
Last reply by bfarber, -
- 8 replies
- 428 views
I don't know if this is a bug or supposed to happen, But if I create a css with a plugin and then someone edits the css file, When they update the plugin the css sheet stays the same (their modified version and not the updated ones), Surely the updated version should override and replace the css sheet no?, The only way to get the newest css is to click revert, This could bring a lot of people thinking the plugin updates are broke when, its not its just not updated their css sheet and a lot of unnecessary support saying you have to click revert etc
Last reply by Tom S., -
- 4 followers
- 9 replies
- 511 views
I've been meaning to ask this for a while since it's a constant issue with my customers, but is the "Upload new version" (UNV) feature working correctly? Ever since 4.0.0, I've been inundated with random bug reports which have been caused by using the UNV feature. My standard reply is "Do a fresh installation of the theme instead of using the UNV feature and it'll work fine". The major issue with this is forum member's need to re-select the freshly installed theme since their choice is reverted to Default. Put simply, can one of the IPS dev's please explain in laymen's terms how this feature works, and why it may potentially cause issues when actually being used? I i…
Last reply by orp, -
- 11 replies
- 375 views
Just a couple more. ? 1. where is the method for displaying moderator permissions for our app in the acp? I was going to see if it's set up in a way where I can easily change which options show up for my app because for 1 content item I have all of the "can" methods return FALSE as it uses a dummy container and then my other content item only uses featuring and unfeaturing basically... and really even then I may just not want mod permissions even for that. For editing/deleting I do my own checks because they're to be done in a different place than moderator panel. 2. Is the built in featuring/unfeaturing only to change the db column, but it's up to us to actuall…
Last reply by Midnight Modding, -
- 4 replies
- 323 views
Should I be doing a flood control check for all forms? While glancing through IPS ones, so far I only see it done in relation to editor inputs and I noticed of course some check related to searching. I assume for searching, it will automatically take care of that for us. In past versions, I set up my own flood control and I think I generally used it on some forms and searching, myself. The only actual flood control method I see, so far, though, specifically checks last post, so it obviously wouldn't be relevant to other apps if used exactly as it is now. We can't really use member_last_post ourselves, for this purpose, can we? Isn't that tied to stats related sp…
Last reply by Midnight Modding, -
- 2 followers
- 3 replies
- 350 views
I can't find the bug tracker so trying here instead. Has the dev folder location changed for css files in IPB 4.3 at all? With a fresh install of an app my /dev/css/admin/form.css file is being added and appears in the browser source code. That same css file will not be added if I perform an application upgrade with the only change being a new css file. Edit: This appears to be the same on IPB 4.2 as well. App install adds admin css just fine, app upgrade doesn't.
Last reply by Daniel F, -
- 1 follower
- 1 reply
- 356 views
I'm working to a bulk importer, I've a field that store Price(2): title,desc,price Hello world,This is an example,44 In the db table the price is stored as: {"USD":{"amount":"44","currency":"USD"}} I need to recreate manually this json using \IPS\nexus\Money object? that with Simply json_encode give: {"amount":"44","currency":"USD"} I recreate the json with: $item->price = '{"'.\IPS\nexus\Customer::loggedIn()->defaultCurrency().'":'.json_encode($price).'}'; But I suspect that there are a better way.
Last reply by teraßyte, -
- 10 replies
- 439 views
Eh, I've had my notification extensions done for ages, but just noticed in notification settings there is nothing there related to my app at all. Did I forget something or it won't show them until the app is actually built? Most eevrything else works in_dev before the app is actually officially built, so I don't know why this would be any different... Hmm... ALso, personally, I wish the notifications settings page would be improved because having all settings one after another, rather than in tabs, is going to get messy. This app I am working on is so huge it has a ton of necessary notification types. So it will be a long list even on its own. I thought about combini…
Last reply by Midnight Modding, -
- 1 follower
- 3 replies
- 290 views
Is there a way to easily differentiate between an invoice generated by a customer and an invoice generated by an Admin in the ACP? I can't seem to find an easy way to figure this out, short of looping through the customer history table. If there isn't a way, can there be one (perhaps for 4.4)? I have more than one customer who is asking for ACP-generated invoices to be treated differently than regular invoices. In most cases, an invoice generated by an Admin is usually to handle a special case where the customer (for whatever reason) is either not purchasing from the standard commerce packages or cannot pay via those means. When this happens, you may not want the inv…
Last reply by Mark, -
- 1 follower
- 3 replies
- 335 views
I wanted to implement the feature "Recommended Replies" in one of my applications, but after looking at the code I discovered that it works only for the comments class and not for reviews too. Can you consider extending this feature to reviews? I don't think I'm the only one that would like to recommend reviews too, especially good ones... ? Or did I miss a way to implement it for reviews?
Last reply by Midnight Modding, -
- 3 followers
- 26 replies
- 861 views
Is any of the following required for any features in particular, for content items? 'author', 'updated', 'ip_address' in $databaseColumnMap. I see if updated is set, it updates the time and when author is used, it can use it for built in generic edit permission checks, but anything I am not thinking of that would need those? And ip address, I haven't noticed an issue from not storing that, at this point, but was thinking I saw somewhere that it was required for something...
Last reply by Midnight Modding, -
- 4 replies
- 325 views
I don't understand what couldEdit() is even used for. In the normal edit methods in ip.suite it already checks canEdit(), anyway, and couldEdit() is checked within canEdit(), but then when the form is submitted, it specifically checks couldEdit() again, even though it would be checking it within canEdit() later in the method, anyway. And, also, the same moderator permission check is done in both couldEdit() and canEdit(). What confuses me the most is I did not even set up anything to do with moderator permissions or set an author field for my content item, but for some reason I pass the couldEdit() check and someone else in the acp does NOT pass it! Is moderator…
Last reply by Midnight Modding, -
- 2 followers
- 6 replies
- 452 views
Hi I'm trying to find a cookie notice plugin, ive found 2 on the market place, one hasnt been updated since 2015 so not sure if it works. The other gives me an error when activated. Error given by the one on the bottom is I dont know how to fix that. Are there any other alternatives ?
Last reply by Steve Bullman, -
- 8 replies
- 415 views
1. a way to get html into an error_message? 2. when I use lang="" in the template to display a translatable lang bit, it's not parsing break tags from the editor. Why? I don't see first party translatable lang bits having anything done to them other than the lang="". Actually I think I figured out #2. I think someone just pasted directly into the editor with break tags... I went and replaced a couple with actual line breaks and it displays properly.
Last reply by Midnight Modding, -
- 2 followers
- 2 replies
- 318 views
I would suggest to improve following code: #system/Task/Task.php:64-79 /* Task completed successfully and a new offset was returned - store the value and then return it */ /*....*/ $newData = json_encode( $json ); /* Did it change?? */ if ( $newData !== $json ) { $queueData['data'] = $newData; \IPS\Db::i()->update( 'core_queue', array( 'data' => $newData ), array( 'id=?', $queueData['id'] ) ); } FIX: $newData !== $queueData['data'] tested with 4.3.1
Last reply by BomAle, -
- 4 followers
- 4 replies
- 396 views
In an app I'm developing I have the need to do a number range filtering on search results, for showing items where the price is between 100 and 200, for instance. Due to the insanely improved relevancy sorting you get by using Elastic over MySQL, we have to use Elastic. But how can I add my own data to the index? Looking at IPS\Content\Search\Elastic\Index::init(), that (as with the rest of the search classes) method does not offer an easy way to modify, only way is to duplicate the whole method in a hook. May I suggest two new indexes there? "index_extra_number" and "index_extra_string". Both for cases where 3rd party apps have a need to index additional data. …
Last reply by bfarber, -
- 2 replies
- 389 views
Hi, I'm in the process of finally migrating our custom 3.x apps to 4.x and have a form helper related question. We've got a few scenarios where we currently use a GET form for list filtering in order to retain params in the URL. From what I can see the Form Helper hard sets the method to POST for all forms. Digging through the code I noted that the in the Advanced Search feature (IPS\core\modules\front\search) a pseudo GET approach is taken by appending the relevant params and redirecting back to the form. I've followed the Advanced Search example, but am stuck on an issue.... The page receives the initial POST, appends the params and redirects as expected, …
Last reply by BikeHub,