• Content count

  • Joined

  • Last visited


About TSP

  • Rank
    Needs Life

IPS Marketplace

  • Resources Contributor Total file submissions: 7

Recent Profile Visitors

102,749 profile views

TSP's Activity

  1. TSP added a post in a topic Loading Navigation twice - this sait & not only   

    The second occurrence is the mobile navigation.
    This is quite a common approach for menus on responsive sites. The reason being the menus are usually laid out quite differently on the mobile view and the desktop view. Which would make it impossible or at least very finicky to try and achieve it all with the same markup and just different CSS. It's easier to just have different markups to work with in that case.
  2. TSP added a comment on a blog entry Month in Review - June 2015   

    Gongratulations on switching to Git 
    Hope you'll enjoy it!
  3. TSP added a bug in Bug Tracker   

    Incorrect CSS-naming of cUserLink
    <li id="cUserLink"> ... </li>Unless I've misunderstood it should be #elUserLink or it should be defined as a class. 
    • 2 replies
  4. TSP added a comment [utf8converter] using the tools and get non working board.   

    Have a look in cache/sql_latest_error.cgi and see what it says, that will say what's wrong. 
    I would submit a support ticket though. 
  5. TSP added a bug in Bug Tracker   

    ipsProgressBar can break due to language locale
    I saw this in the background processes list. After I had installed a language pack I noticed that the progress bar no longer had a blue indicator on it. 
    I found out that this is due to the locale settings for the locale I had chosen, where numbers have commas to separate whole numbers from decimals. 
    You use this number format rule for the number in the generated CSS-style on the element too, but using comma in place of a dot is not valid CSS. So it should not use the locale setting in these scenarios. 

    • 0 replies
  6. TSP added a post in a topic Suggestion to improve rebuild process: go backwards   

    I've decided to at least try this idea. I can't see any disadvantages, if any IPS Developers could give me a good reason you don't already do this, then please do. And if there's no reason then I would wish you to implement this sort of idea into a future update. 
    Here is my changes: 
    Date: Sat Jun 27 23:33:13 2015 +0200 RebuildPosts rebuild backwards diff --git a/www/applications/core/extensions/core/Queue/RebuildPosts.php b/www/applications/core/extensions/core/Queue/RebuildPosts.php index ac35446..09a638b 100644 --- a/www/applications/core/extensions/core/Queue/RebuildPosts.php +++ b/www/applications/core/extensions/core/Queue/RebuildPosts.php @@ -63,6 +63,8 @@ class _RebuildPosts { return null; } + + $data['offset'] = $data['count'] + 1; return $data; } @@ -97,7 +99,7 @@ class _RebuildPosts catch( \RuntimeException $e ){} $where = ( is_subclass_of( $classname, 'IPS\Content\Comment' ) ) ? ( is_array( $classname::commentWhere() ) ? array( $classname::commentWhere() ) : array() ) : array(); - $select = $classname::db()->select( '*', $classname::$databaseTable, array_merge( $where, array( array( $classname::$databasePrefix . $classname::$databaseColumnId . ' > ?', $offset ) ) ), $classname::$databasePrefix . $classname::$databaseColumnId . ' ASC', array( 0, $this->rebuild ) ); + $select = $classname::db()->select( '*', $classname::$databaseTable, array_merge( $where, array( array( $classname::$databasePrefix . $classname::$databaseColumnId . ' < ?', $offset ) ) ), $classname::$databasePrefix . $classname::$databaseColumnId . ' DESC', array( 0, $this->rebuild ) ); $iterator = new \IPS\Patterns\ActiveRecordIterator( $select, $classname ); $last = NULL; @@ -107,10 +109,10 @@ class _RebuildPosts /* If the ID is greater than the max we started with, don't rebuild - we're done because this post and any newer will have been posted under 4.0 already */ - if( $item->$idColumn >= $data['count'] ) + /*if( $item->$idColumn >= $data['count'] ) { return NULL; - } + }*/ $member = \IPS\Member::load( $item->mapped('author') ); $extensions = \IPS\Application::load( $classname::$application )->extensions( 'core', 'EditorLocations' ); @@ -212,6 +214,6 @@ class _RebuildPosts throw new \OutOfRangeException; } - return array( 'text' => \IPS\Member::loggedIn()->language()->addToStack('rebuilding_stuff', FALSE, array( 'sprintf' => array( \IPS\Member::loggedIn()->language()->addToStack( $class::$title . '_pl', FALSE, array( 'strtolower' => TRUE ) ) ) ) ), 'complete' => $data['count'] ? ( round( 100 / $data['count'] * $offset, 2 ) ) : 100 ); + return array( 'text' => \IPS\Member::loggedIn()->language()->addToStack('rebuilding_stuff', FALSE, array( 'sprintf' => array( \IPS\Member::loggedIn()->language()->addToStack( $class::$title . '_pl', FALSE, array( 'strtolower' => TRUE ) ) ) ) ), 'complete' => $data['count'] ? ( round( 100 - (100 / $data['count'] * $offset), 2 ) ) : 100 ); } -} \ No newline at end of file +} diff --git a/www/system/Task/Task.php b/www/system/Task/Task.php index 7b84ffc..76d49fe 100644 --- a/www/system/Task/Task.php +++ b/www/system/Task/Task.php @@ -49,10 +49,18 @@ class _Task extends \IPS\Patterns\ActiveRecord throw new \InvalidArgumentException; } + $offset = 0; + if ( method_exists( $extensions[ $key ], 'preQueueData' ) ) { $class = new $extensions[ $key ]; $data = $class->preQueueData( $data ); + + if( isset( $data['offset'] ) and $data['offset'] != 0 ) + { + $offset = $data['offset']; + } + if ( $data === NULL ) { return; @@ -91,7 +99,8 @@ class _Task extends \IPS\Patterns\ActiveRecord 'date' => time(), 'app' => $app, 'key' => $key, - 'priority' => $priority + 'priority' => $priority, + 'offset' => $offset ) ); \IPS\DB::i()->update( 'core_tasks', array( 'enabled' => 1 ), array( '`key`=?', 'queue' ) );  
  7. TSP added a bug in Bug Tracker   

    Querying for post content twice (Slow rebuild)
    You have at least two tasks that work on the posts-table: 
    applications/forums/setup/upg_100028/upgrade.php: \IPS\Task::queue( 'core', 'RebuildContentImages', array( 'class' => 'IPS\forums\Topic\Post' ), 3, array( 'class' ) ); applications/forums/setup/upg_40000/upgrade.php: \IPS\Task::queue( 'core', 'RebuildPosts', array( 'class' => 'IPS\forums\Topic\Post' ), 2 );I can't see any reason this needs to be two tasks. (?)
    They both query for the contentColumn from the posts-table and goes through all the rows. Which seems silly, as you'll potentially spend twice the time necessary on retrieving post rows and saving it again. 
    With 22.5 million posts to go through this is a very time consuming task.
    I know this is probably technically not a bug, but it seems like a complete waste of time and resources which only makes the upgrade-tasks finish slower. 
    This should be put into only one task for those still not upgraded from 3.X, that only retrieves the post rows once. 
    • 2 replies
  8. TSP added a bug in Bug Tracker   

    Rebuild process going through empty custom profile fields
    @bfarber: I'm not sure if you addressed this while you were also fixing this: https://community.invisionpower.com/4bugtrack/rebuild-process-going-through-empty-signatures-r6372/
    But I'm having the same issue with the rebuild for the about me-field. This is the rebuildNonContentPosts-task for the core_CustomField-extension. 
    You run an offset query for this, which gets slower over time. I have 170 946 rows, so this is a problem.
     There is actually only 8 distinct about me-fields on this community. The real problem is that you rebuild a bunch of empty content. 170 939 rows have a blank value for the profile field. You should run this query before the rebuild process: UPDATE dol_core_pfields_content SET field_11=NULL WHERE field_11=''; (Where you obviously need to run this for each of any found profile fields and replace "11" with correct ID.
     Maybe take a look into why it adds two empty lines for empty content? Which seems silly to me, but maybe you have a good reason. 
    • 1 reply
  9. TSP added a comment Invalid use of NULL value during upgrade   

    This was supposed to be a comment of what I found out, but your security rules blocks it >_>
    Here is it at pastebin: http://pastebin.com/GnHwLMVP
    I found numerous queries where this error popped up and I had to fix them manually. 
    Summary: you should make it so the columns will not have any NULL-values before you attempt to change it to use NOT NULL.
    EDIT: For my own reference I also received the same error for these queries, which I was tasked to run manually: http://pastebin.com/7KFGEa95
  10. TSP added a bug in Bug Tracker   

    Invalid use of NULL value during upgrade
    Version: (Test upgrade from 3.4.8)
    Error: Invalid use of NULL value (Error code: 1138)
    File: /nfs/home/preben/sites/doktoronline/www/applications/core/sources/Setup/Upgrade.php::975
    Code extract (The line with runManualQueries is what it complains about.)
    protected function step10( $data ) { return $this->appLoop( $data, function( $app ) use( $data ) { $changesToMake = \IPS\Application::load( $app )->databaseCheck(); if ( count( $changesToMake ) ) { $toRun = \IPS\core\Setup\Upgrade::runManualQueries( $changesToMake ); if ( count( $toRun ) ) { $mr = json_decode( urldecode( \IPS\Request::i()->mr ), TRUE ); $mr['extra']['_upgradeStep'] = 10; \IPS\Request::i()->mr = urlencode( json_encode( $mr ) ); return \IPS\Theme::i()->getTemplate( 'forms' )->queries( $toRun, \IPS\Http\Url::internal( 'controller=upgrade' )->setQueryString( array( 'key' => $_SESSION['uniqueKey'], 'mr_continue' => 1, 'mr' => \IPS\Request::i()->mr ) ) ); } } return NULL; } ); } 
    • 1 reply
  11. TSP added a comment [This Site] Searching contributor forum always no results   

    I'm unable to get any result when searching in the forum too. 
    Maybe it doesn't take permissions given by a group when it's a secondary group into account?
  12. TSP added a comment [] Suboptimal results returned when searching for display name in ACP/PM   

    I think I remember you fixing this earlier in the search section (for the member search) where you chose to sort by some smart MySQL-method I can't remember at the top of my head (but it was not just on the length of the name). But I think I've had a similar bug report to this before and that's how it was fixed. 
    Was that not an option here, has it been reverted or did you forget? 
    But in any case, sorting by the lenght of the name seems a sensible way than how this was. 
  13. TSP added a comment Old direct links to content   

    You also redirected index.php?showtopic=940396&findpost=16473036 on 3.4, although I'm not sure if that link is given away anywhere in 3.4. It may have been earlier versions. 
  14. TSP added a bug in Bug Tracker   

    Old direct links to content
    Link: index.php?showtopic=940396&p=16473036
    Only redirects to topic, not the post in it
    Link: index.php?showtopic=15&page=2
    Only redirects to topic, not the page
    Both of these links is valid links on IPS 3.4 and provided to the end user, and I know they're used, but they're not being redirected like they should for IPS 4 since they only take the topic value into account. 
    • 1 reply
  15. TSP added a bug in Bug Tracker   

    Email titles not indicating the type of content
    I think the change to remove member names from titles is very good  
    But now it also lacks information about the type of content and where it was posted in the cases where it's a new item.
    Is this intended? Are there options to still display this in that case? I'll post feedback if it's meant to be intended.
    • 2 replies