Jump to content

Community

teraßyte

+Clients
  • Posts

    31,895
  • Joined

  • Days Won

    11

teraßyte last won the day on October 1 2012

teraßyte had the most liked content!

About teraßyte

  • Birthday 12/18/1986

IPS Marketplace

  • Resources Contributor
    Total file submissions: 30

Recent Profile Visitors

23,874 profile views
  1. I forgot to post the error I'm getting, here it is: class_uses(): object or string expected This happens because the function isQuestion() doesn't exist and once the code reaches the else part with the \IPS\IPS::classUsesTrait( $this, 'IPS\Content\Solvable' ) check the static::$commentClass variable doesn't exist and NULL is used instead.
  2. I have an application that uses only $reviewClass and NO $commentClass which throws an error after upgrading to 4.6. This happens because loading the reviews then goes on to call the function _comments() from system\Content\Item::reviews() to load the data. The error is because of this code added in system\Content\Item::_comments() to handle solved contents, statistics, and recognized content (lines 4349-4400): /* Solved count */ $commentClass = static::$commentClass; $showSolvedStats = FALSE; if ( method_exists( $this, 'isQuestion' ) and $this->isQuestion() ) { $showSolvedStats = TRUE; } else if ( \IPS\IPS::classUsesTrait( $this, 'IPS\Content\Solvable' ) and ( $this->containerAllowsMemberSolvable() OR $this->containerAllowsSolvable() ) ) { $showSolvedStats = TRUE; } if ( $showSolvedStats ) { $memberIds = array(); $solvedCounts = array(); $authorField = $commentClass::$databaseColumnMap['author']; foreach( $results as $id => $data ) { $memberIds[ $data->$authorField ] = $data->$authorField; } if ( \count( $memberIds ) ) { foreach( \IPS\Db::i()->select( 'COUNT(*) as count, member_id', 'core_solved_index', array( \IPS\Db::i()->in( 'member_id', $memberIds ) ), NULL, NULL, 'member_id' ) as $member ) { $solvedCounts[ $member['member_id'] ] = $member['count']; } foreach( $results as $id => $data ) { if ( isset( $solvedCounts[ $data->$authorField ] ) ) { $results[ $id ]->author_solved_count = $solvedCounts[ $data->$authorField ]; } } } } /* Recognized content */ if ( \IPS\IPS::classUsesTrait( $commentClass, 'IPS\Content\Recognizable' ) ) { foreach( \IPS\Db::i()->select( '*', 'core_member_recognize', [ [ 'r_content_class=?', $commentClass ], [ \IPS\Db::i()->in('r_content_id', array_keys( $results ) ) ] ] ) as $row ) { if ( isset( $results[ $row['r_content_id'] ] ) ) { $results[ $row['r_content_id'] ]->recognized = \IPS\core\Achievements\Recognize::constructFromData( $row ); } } } To solve the issue I had to wrap the whole thing in an IF check for the class: if ( isset(static::$commentClass) ) { //... {
  3. In \applications\core\api\hello.php you have this code: public function GETindex() { return new \IPS\Api\Response( 200, array( 'communityName' => \IPS\Settings::i()->board_name, 'communityUrl' => \IPS\Settings::i()->base_url, 'ipsApplications' => \IPS\Application::load('core')->version, 'ipsApplications' => array_filter( array_keys( \IPS\Application::applications() ), function( $k ) { return \in_array( $k, \IPS\IPS::$ipsApps ); } ) ) ); } The version line used to have the ipsVersion key, looks like it was overwritten by mistake with ipsApplications: 'ipsVersion' => \IPS\Application::load('core')->version
  4. They can just make it a default template with a code option to change it if you need it to be different. They already do such thing for other templates in the suite already anyway; it's nothing new.
  5. Let me see what I can do about stripping it down to a simple application. The current one relies on having also other apps installed at the same time so you wouldn't be able to test with it alone.
  6. 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 simply skip the ignore code if no Comment class is available, but it should be using the correct Comment/Review class based on the class data being passed to it. Here's a log of the error btw: Error: Class name must be a valid object or a string (0) #0 /home/domain.com/public_html/system/Content/Search/Elastic/Index.php(412): IPS\Content\Search\Elastic\_Index->resetLastComment(Array, 43058, 4048) #1 /home/domain.com/public_html/system/Content/Comment.php(883): IPS\Content\Search\Elastic\_Index->removeFromSearchIndex(Object(IPS\reviews\Product\Review)) #2 /home/domain.com/public_html/system/Content/Review.php(396): IPS\Content\_Comment->delete() #3 /home/domain.com/public_html/applications/reviews/sources/Generic/Item.php(1714): IPS\Content\_Review->delete() #4 /home/domain.com/public_html/system/Helpers/Table/Content.php(679): IPS\reviews\Generic\_Item->mergeIn(Array, false) #5 /home/domain.com/public_html/system/Helpers/Table/Content.php(227): IPS\Helpers\Table\_Content->multimod() #6 /home/domain.com/public_html/applications/reviews/modules/front/products/browse.php(108): IPS\Helpers\Table\_Content->__construct('IPS\\reviews\\Pro...', Object(IPS\Http\Url\Friendly), Array) #7 /home/domain.com/public_html/applications/reviews/modules/front/products/browse.php(35): IPS\reviews\modules\front\products\_browse->_category(Object(IPS\reviews\Pcategory)) #8 /home/domain.com/public_html/system/Dispatcher/Controller.php(96): IPS\reviews\modules\front\products\_browse->manage() #9 /home/domain.com/public_html/system/Dispatcher/Dispatcher.php(152): IPS\Dispatcher\_Controller->execute() #10 /home/domain.com/public_html/index.php(13): IPS\_Dispatcher->run() #11 {main} The issue above happens with Elastic Search, but most likely the normal MySQL search has the same issue.
  7. Let me throw in a quick reminder for IPS to update also the Review class too if they ever get to this (since it often gets forgotten)...
  8. 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\core\Statuses\Reply)) #1 /public_html/system/Content/Search/Elastic/Index.php(245): IPS\Content\Search\Elastic\_Index->resetLastComment(Array, 8206) #2 /public_html/system/Content/Item.php(4389): IPS\Content\Search\Elastic\_Index->index(Object(IPS\core\Statuses\Status)) #3 /public_html/system/Content/Item.php(4155): IPS\Content\_Item->processCommentForm(Array) #4 /public_html/uploads/template_disk_cache/template_3_5c14eba1ca1801cfb0f753db22fb4a43_statuses.php(664): IPS\Content\_Item->commentForm() #5 /public_html/system/Theme/SandboxedTemplate.php(61): IPS\Theme\Cache\class_core_front_statuses->statusContainer(Object(IPS\core\Statuses\Status), Array, Array, false) #6 /public_html/applications/core/sources/Statuses/Status.php(743): IPS\Theme\_SandboxedTemplate->__call('statusContainer', Array) #7 /public_html/system/Content/Search/Result/Content.php(94): IPS\core\Statuses\_Status::searchResult(Array, Array, Array, NULL, Array, NULL, true, 'expanded', false, false, NULL, Array) #8 /public_html/uploads/template_disk_cache/template_3_af46883c13caa197f9e387620d19e6ec_profile.php(2506): IPS\Content\Search\Result\_Content->html() #9 /public_html/system/Theme/SandboxedTemplate.php(61): IPS\Theme\Cache\class_core_front_profile->profileActivity(Object(IPS\Member), Object(IPS\Content\Search\Results), '\n<form accept-c...') #10 /public_html/applications/core/modules/front/members/profile.php(296): IPS\Theme\_SandboxedTemplate->__call('profileActivity', Array) #11 /public_html/system/Dispatcher/Controller.php(96): IPS\core\modules\front\members\_profile->manage() #12 /public_html/applications/core/modules/front/members/profile.php(73): IPS\Dispatcher\_Controller->execute() #13 /public_html/system/Dispatcher/Dispatcher.php(152): IPS\core\modules\front\members\_profile->execute() #14 /public_html/index.php(13): IPS\_Dispatcher->run() #15 {main} #0 /public_html/system/Theme/SandboxedTemplate.php(71): IPS\_Log::log(Object(TypeError), 'template_error') #1 /public_html/applications/core/sources/Statuses/Status.php(743): IPS\Theme\_SandboxedTemplate->__call('statusContainer', Array) #2 /public_html/system/Content/Search/Result/Content.php(94): IPS\core\Statuses\_Status::searchResult(Array, Array, Array, NULL, Array, NULL, true, 'expanded', false, false, NULL, Array) #3 /public_html/uploads/template_disk_cache/template_3_af46883c13caa197f9e387620d19e6ec_profile.php(2506): IPS\Content\Search\Result\_Content->html() #4 /public_html/system/Theme/SandboxedTemplate.php(61): IPS\Theme\Cache\class_core_front_profile->profileActivity(Object(IPS\Member), Object(IPS\Content\Search\Results), '\n<form accept-c...') #5 /public_html/applications/core/modules/front/members/profile.php(296): IPS\Theme\_SandboxedTemplate->__call('profileActivity', Array) #6 /public_html/system/Dispatcher/Controller.php(96): IPS\core\modules\front\members\_profile->manage() #7 /public_html/applications/core/modules/front/members/profile.php(73): IPS\Dispatcher\_Controller->execute() #8 /public_html/system/Dispatcher/Dispatcher.php(152): IPS\core\modules\front\members\_profile->execute() #9 /public_html/index.php(13): IPS\_Dispatcher->run() #10 {main}
  9. 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()->sub( new \DateInterval( 'PT1H' ) )->getTimestamp() ) ) ), 'IPS\Member' ) as $incompleteMember ) The query fails to load any row because the check last_visit=0 fails since the column in the DB contains the value NULL instead. I changed that bit of code to account for both values and the task is working as it should now: (last_visit=0 OR last_visit IS NULL) Full code: 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()->sub( new \DateInterval( 'PT1H' ) )->getTimestamp() ) ) ), 'IPS\Member' ) as $incompleteMember )
  10. As per title ^. When using an area that has reviews enabled (like a File in Downloads) the NEWEST/MOST HELPFUL buttons are NOT available on mobile view. Some people have report it as a bug on our site, but since it's more feedback(?) I'm posting here.
  11. When running the support tool in ACP the guest caching is NOT cleared (since it now uses a different class \IPS\Output\Cache). This causes the old CSS/JS files to be deleted and regenerated but the guest-cached pages returned from the cache still use the old urls causing all pages to be broken. Right now the guests cache is cleared ONLY by a couple of tasks (cleanup.php + clearcache.php) but until those tasks run the pages are broken as I mentioned above.
  12. It would probably help more if you can post the code in your Reborn.php file. Just remove any sensitive data before posting it.
  13. @Kevin Carwile Found a few more errors on the front-end this time around (the one above was in ACP). Here's a list below (all missing root namespaces - also IPS is custting down on call_user_func_array & func_get_args as well): Whoops\Exception\ErrorException thrown with message "You have used a function (in_array) that should be called from the root namespace for performance reasons (applications/advancedtagsprefixes/hooks/forumLastPostPrefix.php::270)." if ( isset( static::$contentItemClass ) and \IPS\Settings::i()->tags_enabled and in_array( 'IPS\Content\Tags', class_implements( static::$contentItemClass ) ) ) ==== Whoops\Exception\ErrorException thrown with message "You have used a function (is_null) that should be called from the root namespace for performance reasons (applications/advancedtagsprefixes/hooks/nodeModel.php::66)." There are 2 "is_null" instances on the same line here. if ( static::isTaggable() === TRUE and !is_null( static::$permApp ) and !is_null( static::$permType ) ) === Whoops\Exception\ErrorException thrown with message "You have used a function (in_array) that should be called from the root namespace for performance reasons (applications/advancedtagsprefixes/hooks/nodeModel.php::233)." if ( isset( static::$contentItemClass ) and \IPS\Settings::i()->tags_enabled and in_array( 'IPS\Content\Tags', class_implements( static::$contentItemClass ) ) ) === In the hook "applications/advancedtagsprefixes/hooks/forumLastPostPrefix.php" replace 3 instances of "call_user_func_array/func_get_args": return call_user_func_array( 'parent::setLastComment', func_get_args() ); with: return parent::setLastComment($comment); === In the hook "applications/advancedtagsprefixes/hooks/forumLastPostPrefix.php" replace 1 instance of "call_user_func_array/func_get_args/is_null": $result = call_user_func_array( 'parent::lastPost', func_get_args() ); if( !is_null( $result ) ) with: $result = parent::lastPost(); if( !\is_null( $result ) ) === In the hook "applications/advancedtagsprefixes/hooks/forumLastPostPrefix.php" replace 1 instance of "is_array/in_array": is_array( \IPS\Member::loggedIn()->modPermission( 'forums' ) ) and in_array( $this->_id, \IPS\Member::loggedIn()->modPermission( 'forums' ) ) with: \is_array( \IPS\Member::loggedIn()->modPermission( 'forums' ) ) and \in_array( $this->_id, \IPS\Member::loggedIn()->modPermission( 'forums' ) )
  14. @Adriano Faria Just a quick note that this application throws an error when using IN_DEV with 4.4 because 6 functions in the file applications/linkedaccounts/hooks/la_getAccounts.php don't use the root namespace. I simply updated the 2 functions in this line below 3 times: return call_user_func_array( 'parent::' . __FUNCTION__, func_get_args() ); to: return \call_user_func_array( 'parent::' . __FUNCTION__, \func_get_args() );
  15. @Kevin Carwile Here's a quick bug report after I upgraded the application to 3.2.0 on a site I manage for someone: PHP Warning: Declaration of IPS\Content\advancedtagsprefixes_hook_addPrefixToForm::tagsFormField($item, $container) should be compatible with IPS\Content\_Item::tagsFormField($item, $container, $minimized = false) in 141 on line 407 The fix is to simply update line 233 in the hook from: public static function tagsFormField( $item, $container ) to: public static function tagsFormField( $item, $container, $minimized = FALSE ) and also line 260 from: parent::tagsFormField( $item, $container ) to: parent::tagsFormField( $item, $container, $minimized ) 👍
×
×
  • Create New...

Important Information

We use technologies, such as cookies, to customise content and advertising, to provide social media features and to analyse traffic to the site. We also share information about your use of our site with our trusted social media, advertising and analytics partners. See more about cookies and our Privacy Policy