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
-
- 1 follower
- 3 replies
- 293 views
I created a new type of profile field but I can't seem to find how to use my own template as it doesn't has a class on form helper due to that in CustomField model: /** * Build Form Helper * * @param mixed $value The value * @param callback $customValidationCode Custom validation code * @return \IPS\Helpers\Form\FormAbstract */ public function buildHelper( $value=NULL, $customValidationCode=NULL ) { $class = '\IPS\Helpers\Form\\' . $this->type; /* Hooks can add custom field types which are stored in the database. Toggling the hook can then stop the hook from loading the field class giving a class not found error */ if ( ! class_exists( …
Last reply by bfarber, -
- 1 follower
- 1 reply
- 302 views
I have a \IPS\Content\Item class that implements \IPS\Content\Searchable. I've successfully gotten it to display arbitrary content in the search snippet in expanded view: I have not, however, succeeded in getting anything in condensed view. Other content items have a "user posted a ___ in ___", but mine shows nothing: When I look at the other applications shown in this picture, this isn't stored in the snippet template. As far as I can tell, something's displaying the language item "x_created_(class)" or "x_created_(class)_in" here, but I don't know how to tell the system to do so for my content item. Simply making sure those language items exist isn…
Last reply by evandixon, -
- 1 follower
- 13 replies
- 370 views
I shall win the "weirdest bug found" award this year for this one! just watch the video, i am not going to be able to explain this one, you just gotta see it to believe it 🙂
Last reply by bfarber, -
- 2 followers
- 4 replies
- 308 views
I need to have a background task to replace some content in some posts. Example post: <blockquote class="ipsQuote" data-gramm="false" data-ipsquote="" data-ipsquote-contentapp="forums" data-ipsquote-contentclass="forums_Topic" data-ipsquote-contentcommentid="24552935" data-ipsquote-contentid="1819682" data-ipsquote-contenttype="forums" data-ipsquote-timestamp="1534422313" data-ipsquote-userid="278655" data-ipsquote-username="Slettet-lYlo5C"> <div class="ipsQuote_citation"> TSPbot2 skrev (På 16.8.2018 den 14.25): </div> <div class="ipsQuote_contents ipsClearfix" data-gramm="false"> <p> This is my post <a href="https://w…
Last reply by bfarber, -
- 2 replies
- 201 views
Hello, system/Task/Task.php if ( method_exists( $extensions[ $key ], 'preQueueData' ) ) { $class = new $extensions[ $key ]; $data = $class->preQueueData( $data ); if ( $data === NULL ) { return; } } Based on DocBlock the method preQueueData() should return an array /** * Parse data before queuing * * @param array $data * @return array */ public function preQueueData( $data ) Ok. You allow to return NULL as you do in some background tasks. But a queue will not be run (added into core_queue table) and the method postComplete() will not be executed. Examples - applications/core/extensions/core/Queue/Re…
Last reply by Daniel F, -
- 1 reply
- 209 views
I'm having a really frustrating experience with this "CSS selector" feature. I'm simply trying to disable the "Show results" button in polls. I can successfully control other elements of the poll's rendering, but anything "deep" doesn't seem to be targetable. I've tried the built in picker. I've tried manual selectors. I've verified in a browser that they select one and only one correct element. It simply doesn't do anything. What am I not understanding? Example #1: Replacing the entire pollcontents works div.ipsPad.ipsClearfix[data-role='pollContents'] Correct: Example #2: div.ipsPad.ipsClearfix[data-role='pollContents'] ol.ipsList…
Last reply by Matt Summers, -
- 5 replies
- 288 views
Hello, $form->add( new \IPS\Helpers\Form\Upload( 'video_test', null, false, array( 'allowedFileTypes' => array( 'mp4' ), 'storageExtension' => 'app_Extension' ) ) ); Uploaded video
Last reply by bfarber, -
- 1 reply
- 215 views
Hello, Simple abstract code $table = new \IPS\Helpers\Table\Db('app_records', \IPS\Http\Url::internal('app=app&module=module&controller=controller')); $table->exclude = array('record_id'); $table->advancedSearch = array( 'record_member_id' => \IPS\Helpers\Table\SEARCH_MEMBER, ); \IPS\Output::i()->output = $table; generates an error array_key_exists() expects parameter 2 to be array, null given File: \system\Helpers\Table\Db.php Line: if( ( ( $this->include !== NULL and !\in_array( $k, $this->include ) ) or ( $this->exclude !== NULL and \in_array( $k, $this->exclude ) ) ) and !array_key_exists( $k, $advan…
Last reply by bfarber, -
- 1 follower
- 2 replies
- 250 views
I discovered something while investigating an issue. When a post with a quote is submitted to the database it stores it like this: <blockquote class="ipsQuote" data-gramm="false" data-ipsquote="" data-ipsquote-contentapp="forums" data-ipsquote-contentclass="forums_Topic" data-ipsquote-contentcommentid="25160025" data-ipsquote-contentid="1840499" data-ipsquote-contenttype="forums" data-ipsquote-timestamp="1573983633" data-ipsquote-userid="58981" data-ipsquote-username="TSP"> <div class="ipsQuote_citation"> TSP skrev (Akkurat nå): </div> <div class="ipsQuote_contents ipsClearfix" data-gramm="false"…
Last reply by CoffeeCake, -
- 6 replies
- 282 views
Hello, I'm adding a send message button in the stock records display template in pages. I can't seem to get the message to display the article posters name when the message pop up comes up. I'm using this code here <a href='{url="app=core&module=messaging&controller=messenger&do=compose&to={$member->member_id}" seoTemplate="messenger_compose"}' data-ipsDialog data-ipsDialog-title='{lang="compose_new"}' data-ipsDialog-remoteSubmit data-ipsDialog-flashMessage="{lang="message_sent"}" class='ipsButton ipsButton_primary ipsButton_small'><i class='fa fa-envelope'></i> <span> {lang="message_send"}</span></a> …
Last reply by DesignzShop, -
- 1 reply
- 226 views
Everytime I update (since 4.4.6) it resets the default_theme on init.php: // Default theme ID // It isn't really possible to change this but we have it defined as a constant rather // than putting "1" everywhere in the code just in case. If you deleted theme ID 1 and attempt to // build a custom application as a developer, you may need to override this value to specify a new // default/unmodified theme. 'DEFAULT_THEME_ID' => 1, I'm already on theme ID 44 due to that and I have to edit it everytime I update the board.
Last reply by Ryan Ashbrook, -
- 3 followers
- 3 replies
- 277 views
It will certainly be my fault but I waste a lot of time to find the issues that are reported to me by whoops. In this case for example I have a warning generated in the FormAbstract.php that had never happened to me: // from: /Users/sviluppo/Documents/sites/44x.test/system/Helpers/Form/FormAbstract.php THIS IS THE ERROR: "var_dump(): Property access is not allowed yet" full stack report also a file in my app but with no comments. // from: /Users/sviluppo/Documents/sites/44x.test/system/Dispatcher/Controller.php Any advices on what and where to look?
Last reply by bfarber, -
- 1 follower
- 2 replies
- 227 views
I came over this by accident and not really sure what problems it'll cause, if any. But something seems very wrong to me, unless I'm missing something. The reason I came over it is because on this community we've never used the archive posts feature, and so I was investigating whether I could just delete the task for the \IPS\forums\Topic\ArchivedPost class. Which I at first ended up concluding I can do in theory, but then I discovered it actually changes values for rows in the reputation index anyway, even when the rows in question have already been changed for the queue task for the IPS\forums\Topic\Post-class. When upgrading from 3.4 to 4.4 you kick off tw…
Last reply by TSP, -
- 1 reply
- 312 views
The exception above has been recently reported to me, it can occur when using \IPS\Member\Group::groups() in tasks executed by cron. In \IPS\Member\Group::getStore() i found the following code: if ( !isset( \IPS\Data\Store::i()->groups ) ) { \IPS\Data\Store::i()->groups = iterator_to_array( \IPS\Db::i()->select( 'core_groups.*', 'core_groups', NULL, 'core_sys_lang_words.word_custom' )->join( 'core_sys_lang_words', array( "lang_id=? AND word_app=? AND word_key=CONCAT( 'core_group_', core_groups.g_id )", \IPS\Member::loggedIn()->language()->id, 'core' ) )->setKeyField( 'g_id' ) ); } # …
Last reply by bfarber, -
- 1 follower
- 1 reply
- 196 views
In background tasks and upgrade tasks you generally seem to like updating the database even though the values you'd like to update is the same. I can understand that this might make sense to do in some circumstances, but in cases where it's not much extra work to check if it's the same values, it could speed up the execution of background tasks and upgrade processes quite a bit. As an example of a background task that I saw benefit from this is: applications/forums/extensions/core/Queue/TopicStarterIds.php In the majority of cases the initial value will be correct, so it doesn't make sense to spend time updating every row. As an added note: t…
Last reply by bfarber, -
- 1 follower
- 4 replies
- 313 views
There was a thread saying we should not copy large part of the IPS core code. I agree, I do not like to copy something that already exists. I have asked several times before but have not get any answer. That's why I try again here. Is there any default templates we can use to output to the frontend: category nodes to browse through content items to browse through content item including moderation functions, report, follow buttons and so on. comments for the content item reviews for the content item I just need Yes/No answer for each list item above. And if Yes then what template to use. If No, then it would mean I have to copy large…
Last reply by Sonya*, -
- 9 replies
- 340 views
Hi, I only found one reference to TypeScript in the forums. I assume TypeScript is not supported or unpopular? I would like to port a complex Swift iPhone app ( https://www.PsychologyByNumber.com ) to a web-based application to support non-iPhone devices. The Javascript language is too simplistic. I need true class inheritance and Swift-like enum support. How have you solved around this problem? Thanks, Mike
Last reply by bfarber, -
- 1 follower
- 1 reply
- 300 views
Which Bootstrap is compatible with IP.Board 4.4.7?
Last reply by bfarber, -
- 1 reply
- 225 views
I've noticed a recurring template_error logged in ACP, after looking into it some more it seems to be thrown when someone replies to a status update on a profile and ES tries to index it. Here's the message and backtrace: TypeError: Argument 1 passed to IPS\Content\Search\Elastic\_Index::getIndexId() must implement interface IPS\Content\Searchable, instance of IPS\core\Statuses\Reply given, called in /public_html/system/Content/Search/Elastic/Index.php on line 888 and defined in /public_html/system/Content/Search/Elastic/Index.php:403 Stack trace: #0 /public_html/system/Content/Search/Elastic/Index.php(888): IPS\Content\Search\Elastic\_Index->getIndexId(Object(IPS\…
Last reply by Ryan Ashbrook, -
- 2 followers
- 3 replies
- 242 views
Hi, I'm going through the upgrade code for 3.4 -> 4.x. In applications/core/setup/upg_40000/upgrade.php I found what appears to be an unused variable. Around line 2410 you have the following code: <?php if( \is_array( $data ) AND $_decoded ) { $newPoll = array(); foreach( $data as $_key => $_data ) { if( isset( $_data['question'] ) ) { $data[ $_key ]['question'] = utf8_encode( $_data['question'] ); if( \is_array( $_data['choice'] ) ) { foreach( $_data['choice'] as $_idx => $_choice ) { $data[ $_key ]['choice'][ $_idx ] = utf8_encode( $_choice )…
Last reply by bfarber, -
- 2 followers
- 1 reply
- 236 views
Hi, I'm currently using php-redis 4.2 on my Invision installation, and I was wondering if I could update it to php-redis 5.0.2. As there seems to be some breaking changes in this v5, could IPS run with it without issues? Does anyone of you use this version? Thank you!
Last reply by Martin A., -
- 2 followers
- 6 replies
- 551 views
sorry @bfarber and @everyone else, no video today (sore throat!), has any one else hit this when trying to uninstall an app? IPS\Db\Exception thrown with message "Truncated incorrect DOUBLE value: 'sockets'" Stacktrace: #9 IPS\Db\Exception in /home/michael/public_html/dev/system/Db/Db.php:671 #8 IPS\_Db:preparedQuery in /home/michael/public_html/dev/system/Db/Db.php:1280 #7 IPS\_Db:delete in /home/michael/public_html/dev/system/Node/Model.php:3082 #6 IPS\Node\_Model:delete in /home/michael/public_html/dev/system/Application/Application.php:4294 #5 IPS\_Application:delete in /home/michael/public_html/dev/applications/core/modules/admin/applications/applications.php:11…
Last reply by bfarber, -
- 1 follower
- 1 reply
- 307 views
I recall reading we should report bugs here now? Not 100% sure though... 🙄 Anyway, the task applications/core/tasks/clearincompletemembers.php is not properly cleaning up incomplete accounts for those who signed up with FB/Twitter/etc. We've noticed this issue for a while now, but today I had a better look at it and figured out the issue. The problem is caused by this code on line 54: foreach ( new \IPS\Patterns\ActiveRecordIterator( \IPS\Db::i()->select( '*', 'core_members', array( array( '(name=? OR email=?)', '', '' ), array( '! (members_bitoptions2 & 16384 ) AND joined<? AND (last_visit=0 OR last_visit IS NULL)', \IPS\DateTime::create()-…
Last reply by bfarber, -
- 1 follower
- 3 replies
- 278 views
Not that it really matters I guess... But is there a considered "best practice" on the comment header for a method when extending/hooking it? 1) Copy the original method header comment 2) Copy the original method header comment, and making any necessary clarifications/additions about what you do in the extension 3) Only have a comment telling what you do in the extension of the method. (No copying, so no @param , @return etc either). 4) No comment 5) Dude, noone cares Example of method I may extend and it's header comment: /** * Hide/Delete All Content * * @param string $action 'hide' or 'delete' or 'merge' * @param…
Last reply by newbie LAC, -
- 1 follower
- 2 replies
- 235 views
In: public function parse( $value ) { /* CKEditor sometimes includes these for markers. HTMLPurifier will remove the style attribute so we need to strip them first */ $value = str_replace( '<span style="display: none;"> </span>', '', $value ); /* Clean HTML */ if ( $value and $this->htmlPurifier ) { $value = $this->htmlPurifier->purify( $value ); } /* BBCode, Profanity, etc. */ if ( $value ) { $value = $this->_parseContent( $value ); } /* Clean HTML */ if ( $value and $this->htmlPurifier ) { $value = $this->htmlPurifier->purify( $value ); } What's the reasoning by runni…
Last reply by All Astronauts,