Jump to content

CodingJungle

Clients
  • Posts

    3,066
  • Joined

  • Days Won

    31

Reputation Activity

  1. Like
    CodingJungle got a reaction from InvisionHQ in 4.7.2 Beta 3: InnoDB & MyIsam tables   
    foreach( \IPS\Db::i()->getTables() as $table){ $def = \IPS\Db::i()->getTableDefinition($table); if($def['engine'] === 'MyISAM') { $query = 'ALTER TABLE ' . $table . ' ENGINE=InnoDB;'; \IPS\Db::i()->query($query); } } i use this snippet to convert them over to innodb. it is likely your databases default engine type is myisam instead of innodb (cause not every schema has the engine type when the table is created, so the db installer lets the db server select it. this is what looks like what is happening here). 
  2. Like
    CodingJungle got a reaction from media in 4.7.2 Beta 3: InnoDB & MyIsam tables   
    foreach( \IPS\Db::i()->getTables() as $table){ $def = \IPS\Db::i()->getTableDefinition($table); if($def['engine'] === 'MyISAM') { $query = 'ALTER TABLE ' . $table . ' ENGINE=InnoDB;'; \IPS\Db::i()->query($query); } } i use this snippet to convert them over to innodb. it is likely your databases default engine type is myisam instead of innodb (cause not every schema has the engine type when the table is created, so the db installer lets the db server select it. this is what looks like what is happening here). 
  3. Like
    CodingJungle got a reaction from SeNioR- in 4.7.2 Beta 3: InnoDB & MyIsam tables   
    foreach( \IPS\Db::i()->getTables() as $table){ $def = \IPS\Db::i()->getTableDefinition($table); if($def['engine'] === 'MyISAM') { $query = 'ALTER TABLE ' . $table . ' ENGINE=InnoDB;'; \IPS\Db::i()->query($query); } } i use this snippet to convert them over to innodb. it is likely your databases default engine type is myisam instead of innodb (cause not every schema has the engine type when the table is created, so the db installer lets the db server select it. this is what looks like what is happening here). 
  4. Agree
    CodingJungle reacted to opentype in A better way to detect mobile devices   
    There is nothing simple or better about it. It’s just unreliable. What if use a smaller browser window on desktop? The site would break since it can’t be displayed properly. Because with your method, the code for smaller screens would have been removed. What if PHP can’t detect the device clearly for some reason? Again, the site could break because the wrong version could be delivered. 
    All in all, the benefits of stripping a few lines of unused code don’t outweigh the potential negative consequences. After all, it IS about the screen size, not the “type” of device. The break points are called “desktop”, “tablet” and “mobile” but that is just a convention. The device doesn’t really matter, so recognizing it isn’t the point. It must work for whatever screen size is available and that is something determined (and possibly even changed) on the client side. 
  5. Like
    CodingJungle got a reaction from pukelis in Check if we're on the main board page   
    a possible solution is to check the data in the \IPS\Request::i()->url() method.
    if it is the default app on the "homepage", then ->path should be empty:
    IPS\Http\Url\Friendly Object ( [url:protected] => https://dev.codingjungle.com/ [data] => Array ( [scheme] => https [host] => dev.codingjungle.com [port] => [user] => [pass] => [path] => / [query] => [fragment] => ) [queryString] => Array ( ) [hiddenQueryString] => Array ( [app] => stratagem [module] => view [controller] => projects ) [seoPagination] => [base] => front [seoTemplate] => stratagem [seoTitles] => Array ( ) [friendlyUrlComponent] => ) otherwise it will be populated with the path from the furl:
    IPS\Http\Url\Friendly Object ( [url:protected] => https://dev.codingjungle.com/stratagem [data] => Array ( [scheme] => https [host] => dev.codingjungle.com [port] => [user] => [pass] => [path] => /stratagem [query] => [fragment] => ) [queryString] => Array ( ) [hiddenQueryString] => Array ( [app] => stratagem [module] => view [controller] => projects ) [seoPagination] => [base] => front [seoTemplate] => stratagem [seoTitles] => Array ( ) [friendlyUrlComponent] => stratagem ) there might be a caveat to this, as i haven't fully tested this. it was something off the top of my head. 
     
    btw this could be a good method too, as applications and modules get cached, so it shouldn't cost anything noticeable in loads, well nothing more than most servers can afford to use.
  6. Thanks
    CodingJungle got a reaction from The Old Man in Check if we're on the main board page   
    plus \IPS\Dispatcher already loads these values:
    $app = null; $module = null; if(\IPS\Dispatcher::hasInstance()){ $dispatcher = \IPS\Dispatcher::i(); $app = $dispatcher->application; $module = $dispatcher->module; } if($app !== null && $app->default && $module->default){ //if we are here, we on the default app/module, lets do our thing }  
  7. Like
    CodingJungle got a reaction from IPCommerceFan in Check if we're on the main board page   
    plus \IPS\Dispatcher already loads these values:
    $app = null; $module = null; if(\IPS\Dispatcher::hasInstance()){ $dispatcher = \IPS\Dispatcher::i(); $app = $dispatcher->application; $module = $dispatcher->module; } if($app !== null && $app->default && $module->default){ //if we are here, we on the default app/module, lets do our thing }  
  8. Like
    CodingJungle reacted to Daniel F in Scope Selection sucks   
    Thanks, I have fixed this for an upcoming release.
  9. Like
    CodingJungle reacted to Martin A. in Scope Selection sucks   
    This is a nice one. If you edit it from the overview it goes to the "api" controller, which properly loads the api.css. If you edit it from the OAuth details page it goes to the "oauth" controller which doesn't load the css.
  10. Haha
    CodingJungle got a reaction from SeNioR- in Scope Selection sucks   
    On my production site, with light or dark mode ACP, scope selection for oauth looks like this and it just sucks. i know its not suppose to look like this, cause most of the time it looks normal on my dev site (most of the time, every once in awhile it goes spastic).
    I can't figure out why it is like this on my production site, but it simply just sucks. i've tried everything, i've disabled everything, changed themes, regenerated a stock them, cleared caches, etc, and it always looks like a spruce tree in minecraft got grifted.

    so lets get one of your many talented themers on this 🙂 
  11. Haha
    CodingJungle got a reaction from ASIKOO in Scope Selection sucks   
    On my production site, with light or dark mode ACP, scope selection for oauth looks like this and it just sucks. i know its not suppose to look like this, cause most of the time it looks normal on my dev site (most of the time, every once in awhile it goes spastic).
    I can't figure out why it is like this on my production site, but it simply just sucks. i've tried everything, i've disabled everything, changed themes, regenerated a stock them, cleared caches, etc, and it always looks like a spruce tree in minecraft got grifted.

    so lets get one of your many talented themers on this 🙂 
  12. Agree
    CodingJungle got a reaction from HeadStand in Issue with entering credit card numbers   
    there are like 15 different "spaces" in unicode 😛 
  13. Like
    CodingJungle got a reaction from cst3124 in [CJ] Keyword Tooltips (Support Topic)   
    it currently only works for apps that use the content item class from IPS, blocks use nodes. The reason it supports the content item classes, is cause it has a structure to display the output, nodes don't have this. so it is not as easy. I'll see about expanding it to blocks, but can't make any promises here. 
  14. Like
    CodingJungle got a reaction from SeNioR- in \IPS\Http\Url::external()->request()->get($data) with curl bug   
    I'm not entirely sure if this is \IPS\Http\Request\Curl bug or a problem with the IPS api, but i'm assuming it is a problem with \IPS\Http\Request\Curl cause when forcing \IPS\Http\Request\Sockets this error doesn't happen.
    example code:
    $category = 2; $author = 1; $communityUrl = 'http://codingjungle.test/dev'; $apiKey = '214befc90239f63bc16dd89b4dfbd300'; $endpoint = '/downloads/files'; $response = \IPS\Http\Url::external($communityUrl . '/api/index.php?' . $endpoint. '&key=' . $apiKey)->request()->get(['category' => $category]); if i send the API parameters in get, I receive the following response:
    { "errorCode": "1S303\/8", "errorMessage": "NO_AUTHOR" } which is strange, cause when i got look up this error, i only find it in \IPS\downloads\api\files\POSTindex, but i'm calling $response->get(), so i should be hitting \IPS\downloads\api\files\GETindex with that endpoint. looking a bit further into what is going, this code is in \IPS\Http\Request\Curl::get()
    /** * HTTP GET * * @param mixed $data Data to send with the GET request * @return \IPS\Http\Response * @throws \IPS\Http\Request\CurlException */ public function get( $data=NULL ) { /* Specify that this is a GET request */ curl_setopt( $this->curl, CURLOPT_HTTPGET, TRUE ); $this->dataForLog = NULL; if ( $data ) { curl_setopt( $this->curl, CURLOPT_POSTFIELDS, $data ); } return $this->_executeAndFollowRedirects( 'GET', NULL ); } it appears the CURLOPT_POSTFIELDS is triggering the POST for the API instead of GET (when i use this same code, by using \IPS\Http\Request\Sockets::get() instead by setting \IPS\BYPASS_CURL to true, it works as intended. i get the requested data from the API).
    I believe the \IPS\Http\Request\Curl::get() should be:
    /** * HTTP GET * * @param mixed $data Data to send with the GET request * @return \IPS\Http\Response * @throws \IPS\Http\Request\CurlException */ public function get( $data=NULL ) { /* Specify that this is a GET request */ curl_setopt( $this->curl, CURLOPT_HTTPGET, TRUE ); $this->dataForLog = NULL; if ( \is_array($data) && empty($data) === false ) { $this-url->setQueryString($data); } elseif( $data !== null){ $queryString = []; \parse_str($foo, $queryString ); $this-url->setQueryString($queryString); } return $this->_executeAndFollowRedirects( 'GET', NULL ); }  
  15. Like
    CodingJungle got a reaction from BankFodder in [CJ] Keyword Tooltips (Support Topic)   
    the current version should be compatible with 4.7, but i just released 4.1.3 has a few new features in it. it is available on my site if you purchased there, otherwise you have to wait till it is approved here.
  16. Like
    CodingJungle got a reaction from SeNioR- in [Bug 4.7 & 8.1] PHP Fatal error: Type of IPS\File\_Exception::$file must be string   
    happens in php 8.0.x too, i just ended up deleting the property and its use in the constructor, as it doesn't appear to be used any where else in the file.
  17. Like
    CodingJungle got a reaction from Square Wheels in [CJ] Keyword Tooltips (Support Topic)   
    appears to be working, i have a new version coming out but the upgrades for stratagem and babble took longer so i was unable to get it out and tested before the 4.7 update dropped. i didn't want to push a "maintenance" release just to update the version compatibility to 4.7 with a new version right around the corner. 
  18. Like
    CodingJungle reacted to Colonel_mortis in Controllers can be initialized on detatched DOM nodes if another controller uses cleanContentsOf   
    If you have something like
    <div data-controller="foo"> <div data-controller="bar"></div> </div> ips.controller.register("foo", { initialize: function() { ips.controller.cleanContentsOf(this.scope); } }); The controller on bar will be initialized on the dead element, and never cleaned up:
    ips.controller.register("bar", { initialize: function() { console.log(document.contains(this.scope[0])); // => false }, destroy: function() { console.log("destroyed"); // never called } }); This happens because ips.controller#_findControllers is called once to get all controllers to load, then the controllers are run one by one. If the foo controller is run first (and I'm not sure if that's guaranteed to be the case), cleanContentsOf will drop the bar element, but it won't run the destructor because the controller hasn't been initialized yet. When all of that logic has finished running, it then runs the bar controller, even though it is no longer applicable.
    Sure, you might say, but nobody would call cleanContentsOf synchronously during init, right? Yes, you do.
    Concretely, the problem this causes me is that the commentFeed of a status update exists twice, one in the document and one detatched. This means addToCommentFeed events end up getting processed by both, the detached one first, and the detached one ends up throwing an exception.
    There are a few different ways this could be fixed:
    Fix the double initialization of profiles. Seems straight forward enough, and that appears to be the only instance of this issue at the moment. Guard ips.controller#initControllerOnElem with node.contains(elem), to ensure that the node is still a child Run the destructor code from cleanContentsOf in a `setImmediate` block, to give the other controllers an opportunity to be initialized before getting cleaned up
  19. Like
    CodingJungle got a reaction from SeNioR- in ips.utils.anim.go() doesn't seem to defer properly   
    updating one of my apps, i decided to give the the JS a good dusting to see where i could improve it cause it was a bit long in the tooth.  I noticed i was using my own $.Deferred code to know when the animation was done executing (i'm using ips.utils.anim.go() for some of the animation and jquery ui for some of the others). I couldn't exactly remember why i had setup my own defer, so i tested it out. i removed mine, placed a .promise().done() on the jquery ui effects i was using, worked as expected, then i moved onto the IPS ones and it was not working as expected. the promise is returned instantly, long before the animation is done executing. i tested out a few things, but the same result. I went searching for instances where in your code you are waiting for the defer before executing some code, and my code was virtually identical.  the expected is the promise to be returned when the animation is done executing like it is done in jquery, other wise there is little value to deferring it in the first place if it is instantly going to return the promise long before the animation is done. 
  20. Thanks
    CodingJungle got a reaction from gintonix in [CJ] CJ Duplicate Member Logger (Support Topic)   
    okay i'll test it out and release a fix as soon as possible for it. 
  21. Agree
    CodingJungle got a reaction from gintonix in [CJ] CJ Duplicate Member Logger (Support Topic)   
    i'm not sure i follow what you are asking? are you asking does it send to all the alts too? or just to the "primary" account? it doesn't do a "group" message if that is what you are asking.
    sorry, holiday weekend i was not at home.
  22. Thanks
    CodingJungle got a reaction from Colonel_mortis in Different behaviour between \IPS\Theme::compileTemplates and \IPS\Theme::overloadHooks   
    solved this one awhile back 
     
  23. Agree
    CodingJungle got a reaction from teraßyte in IPS\Helpers\Form\Item   
    this isn't really a bug, but a suggestion. add in the ability to pass a join. I have greatly ignored this form helper in my apps mostly cause of this reason. there are times where being able to add a join is needed for returned results (not to display, but to validate them. like a use case for me, to check to see if item exist in a mapped table to see if it is being used by another app). 
  24. Like
    CodingJungle got a reaction from DawPi in IPS\Helpers\Form\Item   
    this isn't really a bug, but a suggestion. add in the ability to pass a join. I have greatly ignored this form helper in my apps mostly cause of this reason. there are times where being able to add a join is needed for returned results (not to display, but to validate them. like a use case for me, to check to see if item exist in a mapped table to see if it is being used by another app). 
  25. Like
    CodingJungle got a reaction from creativiii in Where is password salt stored?   
    the salt is apart of the password hash in the encryption scheme IPS 4 uses.
    $2y$10$ykiLOC/Lu24CIGUiJmH.1eYlIRvdfBhrd2qEBukwU4Qjmx1UWM96e
    the hashing algo used knows what to use as the salt when you go to compare the passwords to see if they match. 
×
×
  • Create New...