Jump to content

CodingJungle

Clients
  • Posts

    3,066
  • Joined

  • Days Won

    31

 Content Type 

Downloads

Release Notes

IPS4 Guides

IPS4 Developer Documentation

Invision Community Blog

Development Blog

Deprecation Tracker

Providers Directory

Forums

Events

Store

Gallery

Posts posted by CodingJungle

  1. Okay after a bit more digging into the code, i see why this can happen.

    it is any theme hook, that has an override for a template in it or aka "theme hook in php mode"

    try{
    	if ( eval( "namespace IPS\\Theme;\n\n" . str_replace( array( ' extends _HOOK_CLASS_', 'parent::hookData()' ), array( '_tmp', 'array()' ), file_get_contents( $path . '/' . $data['file'] ) ) ) !== FALSE )
      {
          $class = "IPS\\Theme\\" . $data['class'] . "_tmp";
          $templateHooks = array_merge_recursive( $templateHooks, $class::hookData() );
      }
    }
    catch ( \ParseError $e ) { }

    in php 8.0 it is now a fatal error to call a non existing parent class/method, in the latest php 7.4 it is a deprecated.

    so since at this point, the hook in php mode isn't actually extending another class, it is blowing up. this is def an engineering issue on IPS side of things. so technically any theme hook in php mode, that eval and try to call a parent method that doesn't exist, will throw this fatal/warning in the current versions of php. we don't see it while IN_DEV cause templates are compiled differently there. 

    i wonder now if it happens with class hooks, that get wrapped up by IPS try/catch block they place inside every method, even if the method doesn't exist in the parent.  

     

  2. On 7/7/2021 at 6:45 AM, Adriano Faria said:

    Any clue?

    yeah, after further debugging, that wasn't the solution, might've been a stale opcache on my end that made me think it was working. 

    I really don't know now toolbox has a ton of hooks, its gonna take a lot of work to go thru each one and try to find the culprit. 

  3. i've released 2.4.0 of stratagem to the marketplace and my website (the marketplace one might take a little bit to be approved, i heard they have quite a backlog).

    here is the changelog for 2.4.0, a few new features and several fixes.

    • fixed issue with project filters (they now work again :)), also fixed it showing cards that meet 1 or 2 of the criteria for filters instead of all of them.
    • fixed issue for notifications, when a user is removed from a private project, they should now no longer be able to receive new notifications.
    • fixed issue with "limit card view", due to a permission misconfiguration, wouldn't show all cards with a team member who had the permission to "card sort" or "card assign" 
    • fixed/change how calendar integration works. now we use a more custom solution, instead of directly using the calendar app. (still requires the calendar app to be installed, as this new method uses the css/js from calendar). this solution should prevent duplication of strategem calendars and duplicate stratagem events on that calendar, the calendar is now generated at access time, and the card events are generated then and there as well. NOTE: you can safely delete any stratagem calendars that were created by previous versions, as they will no longer be used.
    • Copying: added in copying of project/column/cards. you will enable in project settings if you want copying to be enabled, and then assign the permissions to the teams as you see fit. Note: if a project is has limit card view enabled, then team members will only be able to copy the cards they can see (this also applies if they copy the project, it will only copy the cards they can see). This also applies to columns that have restrictions, if they aren't on the allow list (een if they can see the column and its cards), they will not have the copy option nor will they be copied if the project is copied. Note2: copying cards is a instant action, but copying a column or project runs thru a task, so there might be a delay between copying the column/project, before it shows up or is completed. Note3: A lot of the settings for a project will be copied, but things like "real time mode", "due date", "publish date", "slack hooks", "git repos", and a few others, will not carry over to a copied project, nor will teams. all copied cards from a project, will have their creation date and author updated to the time it was copied and the user who copied the project. 
    • Several new history entries, mostly related to copying cards/columns/projects. 
    • fixed issue with quick access, it should now update properly for any changes to columns.
    • fixed "lock project" and limit card view settings, before if you locked a project with limit card view enabled, it would show the restricted cards to anyone who viewed the project, now it will function as it would before locking the project. 
  4.  

    36 minutes ago, Sonya* said:

    Additionally, when Inserts are created and there are many columns, the control buttons (edit/delete) are out of view.

    just fyi, i got annoyed with the interface issues, and on my toolbox app, one of the tabs that is added is "table imports", this allows you to insert the data thru like phpmyadmin/adminer and then import it into your application. 

  5. 9 hours ago, Joey_M said:

    @CodingJungle: Will this be marked as 4.6 ready or do you need to update the application? I need to renew it, but I am currently on 4.6 and cannot install resources unmarked as 4.6 ready.

    i'm working on a 4.6 update. 

    one of the bigger aspects of this update i'm working on, will be is a custom calendar section, as trying to integrate into the calendar has had varying amounts of success and issues, so i've decided to add a calendar section to stratagem, it will still require calendar as it uses its JS and css, but it doesn't actually use the calendar app itself. this should allow for more things i can do with it eventually 🙂 

  6. On my localhost, with php 7.4 i have E_ALL enabled, and if i am not in_dev mode, my theme hooks for my toolbox app causes this error:

    Cannot use “parent” when current class scope has no parent

    i've tracked it down to the hookData() method:

        public static function hookData()
        { 
    		return parent::hookData(); 
        }

    i've been able to correct it with this code:

        public static function hookData()
        {
            if (is_callable('parent::hookData')) {
                return parent::hookData();
            }
            return [];
        }

    now i am not entirely sure why i have to do this, it only seem to have started with 4.6 (maybe its a change i'm unware of, but i am not sure if it is happening in any of my other apps, as i don't often make theme hooks nor am i often not IN_DEV). now on a proper production server, E_DEPRECATED should be suppressed and this isn't a super priority, its more of a curiosity why it is happening, and why i had to make the change, was it a change in 4.6 theme hooks? is my code just bad? i mean i know some of it is clunky and nonsensical sometimes, but its happening even on the theme hooks that i don't add a theme hook, but i'm overloading a theme method, so the hookData() is just empty, returning the parent. 

    it happens both on my mac and linux pc, so i'm not sure what to think. php version is the latest 7.4 on both. so any ideas?

  7. my request:

    1. can we get documentation for adding API to our apps, I'm having to add it to 3 different apps atm for a project for a client, and i'm really sorta winging it. looking at what you guys have done, but even then its not all that clear what is being done or why.
    2. please document the graphql api you've added, i'm assuming you are using this in your mobile app, since i can't find any reference to it in any of your php/js code.
    3. '/^\s*\*\s*@([a-z]*)(\t+([^\t]*))?(\t+([^\t]*))?(\t+([^\t]*))?$/', found in /system/Api/Controller.php line 319. hopefully I can express how much misery this regex has caused me. you guys are literally the only software or framework i know of, in php or not, that uses tabs in their code. I use spaces, the rest of the world uses spaces, I have git hooks that will actually reject code for using tabs instead of spaces, my IDE is configured to use spaces. so for like .00001% of the over all app, on stuff that isn't even code, i have to undo ALL of that, just so the api reference docs are processed and shown in the ACP for the other devs on this project to have easy access to that info. I spent a good long while trying to figure out why it was not showing or throwing an exception in the api references, as there was no clear indication as to what was causing it or why. so for sanity sake, please make this regex more robust to look for tabs or space (or better yet, not rely on phpdoc block for api reference, make it a json/xml/txt in <app>/data that can be read and parsed out). 
    4. $this->_respond( json_encode( $output, JSON_PRETTY_PRINT ), $response->httpCode, NULL, $shouldLog, TRUE ); /system/Dispatcher/Api.php line 338/342/348., this code does not always produce valid json. it looks like json, but its not, its corrupted. I've had to add 'JSON_HEX_QUOT | JSON_HEX_TAG ' to the flags section of json_encode to get it to produce valid json (i did this thru a hook, but had to overload the entire method, cause there was no point in the code execution, i would be able to add those 2 flags). So please either add those flags or move the json_encode to a method inside the dispatcher, where all it does is json_encode, that way i can hook it and add those flags or any other flags i might need in the near future. 
    5. editor content from the api doesn't not get the file or url place holders replaced, i was pulling articles and blogs records, and none of the internal links or attachments were showing up, cause they still had the <___base_url___> and <filestore> stuff still in them, so i had to go hook blogs and articles api to parse them (haven't gotten to the other apps yet). 
    6. embed/iframe content also is not loaded, cause the src attribute is empty, as the source is still on data-embed-src (i'm assuming this is apart of the IPS lazy loading that didn't get scrubbed properly).
    7. on db records, you include a title property but in 'fields' property, it also includes the title field content as well, so if that can be removed or at least give us the ID of which field_# is the title, same for description. 
    8. can you also include for any dates, a rfc2822 format along with the rfc3339, as javascript does not like the rfc3339 one (example: DateTime::ts($sometimestamp)->format(RFC::882), this will return a rfc2822 formatted date). heck even a raw unix timestamp would be better than a rfc3339 :). 

    to be completely honest, the api has not been a pleasure to write code for or to work with. it is one of the most difficult API's i've used. I have spent about 20 times longer debugging and finding solutions, than i have actually writing code to use the api. any way, i hope you guys can address these issues, if not, I might be forced to abandon the api and find another solution.

  8. I am not entirely sure when this began. I first noticed it 2 to 4 months ago on my local dev environment, but when i moved from a lamp to docker, the problem went away, so i figured it was just something funky in my lamp stack (as one of the reasons i wanted to move away from LAMP to docker, was using different mysql & php version, along with nginx or apache, to tailor the dev environment to my own clients servers). 

    However, I've been getting reports trickling in that a few of my apps, that the settings will not save. so i've been looking into it, and tonight i installed a few of my apps on my clients site. I configured the apps, all went as fine, and then i went back to change another setting, and the new value would not take. so i thought maybe it was a funky cache of settings, so i ran the support tool, nada. I messed around with it for about 20 minutes, decided to back burner it for now, as i had other things i needed to install and do on the site. I did discover, if I installed/updated an app or plugin, the settings that did not change after they were saved or when i did a cache clear. However if i installed or updated an app or plugin, the values would get updated.

    of course with this being third party code it is happening on, i wanted to completely rule out my own code (which btw is pretty boiler plate way to save the settings from the form, but i wanted to remove the possibility it was something in my own code). so i created a test plugin, put a few settings in it, tested it on 3 different servers (my own production server, and 2 of my clients) and sure enough on my server and one of my clients, once after the initial setup of the settings and saving, any subsequent changes/saves, will not be reflected. (i checked their values in the DB and they had been updated, but the store was stale), however running the support tool did not fix this, only installing/updating an app would have the changed settings reflected.

    next to further debug this, i went over to the dev sites of my clients and my site (again on 3 different servers), i disabled all the 3rd party apps and plugins, with the exception of my test plugin. Again on my server and one of the client server that wouldn't change the settings in the previous test, same thing. the settings would update in the DB, clearing the store with the support tool did not work, but installing/updating an app or plugin, they would (even enabling or disabling an app would have no effect). 

    my next test was just try to update the settings manually with changeValues(), my code was simple.

    $settings = [ 'test_plugin_setting_a' => 1, 'test_plugin_setting_b' => 2, 'test_plugin_setting_c' => 3, 'test_plugin_setting_d' => json_encode([1,2,3,4,5,6]) ];
    
    \IPS\Settings::i()->changeValues($settings);

    still no joy.  the settings do exist, they don't have default values, they've been set by the plugins setting panel. as before,  they would be updated in the DB, but not when viewing the settings, they would only show the new values after installing/updating a new app. 

    this is only happening with some 3rd party apps (more on that later) on my server and my clients, i can not duplicate it with IPS settings in IPS apps, but comparing the code, they are virtually identical. I am unable to figure out what is going on, as i've scoured logs too, nothing. there are no errors. servers are all running the latest version of php 7.4, fpm and apache. they all have filesystem as their storage location for the store, mysql versions variate between the servers, but they are different versions but all above the min. version required by IPS.  there is no cloudflare, or any other cdn or cache programs installed. 

    So i re-enabled all the third party apps and plugins (some mine, some not). So i began to change settings in all of them, to see which ones would update and which ones wouldn't. It was just completely random, some of my apps would do it, but others would not, some other third parties apps created by other devs would do it, others would not. looking at their code and mine, its pretty basic stuff, example:

            if ($values = $form->values()) {
                $form->saveAsSettings($values);
                Output::i()->redirect(Request::i()->url()->setQueryString(['do' => 'manage', 'params' => 1])->csrf());
            }

    the above is from my applications stratagem.

    		if ( $values = $form->values() )
    		{
    			if ( isset( $values['forums_popular_now']['never'] ) )
    			{
    				$values['forums_popular_now'] = json_encode( array( 'posts' => 0, 'minutes' => 0 ) );
    			}
    			else
    			{
    				$values['forums_popular_now'] = json_encode( $values['forums_popular_now'] );
    			}
    			
    			if ( isset( $values['forums_default_view_choose'] ) )
    			{
    				$values['forums_default_view_choose'] = ( \is_array( $values['forums_default_view_choose'] ) AND !\count( $values['forums_default_view_choose'] ) ) ? NULL : json_encode( $values['forums_default_view_choose'] );
    			}
    
    			if ( isset( $values['forums_topic_activity'] ) )
    			{
    				$values['forums_topic_activity'] = json_encode( $values['forums_topic_activity'] );
    			}
    
    			if ( isset( $values['forums_topic_activity_features'] ) )
    			{
    				$values['forums_topic_activity_features'] = json_encode( $values['forums_topic_activity_features'] );
    			}
    
    			if ( isset( $values['forums_topics_show_meta'] ) )
    			{
    				$values['forums_topics_show_meta'] = json_encode( $values['forums_topics_show_meta'] );
    			}
    						
    			$form->saveAsSettings( $values );
    
    			/* Clear guest page caches */
    			\IPS\Data\Cache::i()->clearAll();
    
    			\IPS\Session::i()->log( 'acplogs__forums_settings' );
    			\IPS\Output::i()->redirect( \IPS\Http\Url::internal( 'app=forums&module=forums&controller=settings&tab=settings' ), 'saved' );
    		}

    the above is from forums. they both assign $form->values() to $values, and they both user $form->saveAsSettings($values);, the only difference is you guys are doing some post submit processing on the values, i don't need to, but even on the apps that do some post submit processing, this problem creeps up.

    I'm pretty confident its not a code issue, but a server configuration issue of some kind (as to what configuration is causing this i have no clue). I've compared php and mysql config file between my production server, the other client server that is having this issue, with my local dev and the other clients site that isn't having this issue, but nothing is really all the different, and the configs that were different, i made the changes on my production server without any effect.  I can say with the exception of my local dev, the 3 servers are all running centOS 7, with cpanel, with all the latest updates available to them. 

    I only have a server sample of about 10 different servers i can access to test this issue on my own, you guys have potentially access to thousands, has this problem arose else where or been reported to you and you guys pushed it back to the third party dev thinking it was something wrong with their app? has any third party dev reading this, come across this? were you able to find a solution? any help would be appreciated, at this point my only possibly option would be to hack my around \IPS\Settings on the servers that are affected. 

    P.S. I did think maybe it was opcache, but i disabled this on all 3 servers once i noticed the issue, still no joy. 

  9. 1 hour ago, Daniel F said:

    It seems that Stratagem breaks the Calendar Sitemap generation.

     

    
    OutOfRangeException::0
    #0 /var/www/html/105129/init.php(893) : eval()'d code(47): IPS\Patterns\_ActiveRecord::load(133, 'project_calenda...')
    #1 /var/www/html/105129/applications/core/extensions/core/Sitemap/Content.php(186): IPS\calendar\stratagem_hook_calendarEvent::getItemsWithPermission(Array, NULL, NULL, 'read', -1, 0, Object(IPS\Member), NULL, NULL, NULL, true)
    #2 /var/www/html/105129/system/Sitemap/Sitemap.php(85): IPS\core\extensions\core\Sitemap\_Content->getFilenames()
    #3 /var/www/html/105129/applications/core/tasks/sitemapgenerator.php(39): IPS\_Sitemap->buildNextSitemap()
    #4 /var/www/html/105129/system/Task/Task.php(367): IPS\core\tasks\_sitemapgenerator->IPS\core\tasks\{closure}()

     

    they must not be on the latest version, cause it has a try/catch around that section for this reason.

    2021-04-13_04-23.thumb.png.01d81db891fe1950b53828457a8e73ee.png

  10. 40 minutes ago, bfarber said:

    Someone ( @CodingJungle I believe) has a tool which helps support IDE autocomplete, however I'm not certain it helps with templates parameters and syntax.

    about all it does for "templates" is in a limited fashion gives you a template function list for getTemplate (based on the group param) and if it finds the template, will give you param hints (but this is only in phpstorm and if you have the phptoolbox plugin installed for phpstorm).

    2021-03-15_09-06.thumb.png.cb88080c0c8167db6bbb81d735051fe9.png

    for an IDE like phpstorm, i usually assign *.phtml to twig in file types, it doesn't do much, but does add some color.

    before being assign to twig:

    2021-03-15_09-12.thumb.png.412fb325b266729e462a63ca26774262.png

    after being assigned to twig:

    2021-03-15_09-13.thumb.png.a5a0698deff07eaaead49d3a1eedd405.png

    but other than that, there isn't any plugin i know of that will assist with IPS templates and i'm not crafty enough with java to make one 🙂 

  11. 8 minutes ago, Midnight Modding said:

    Still confusing, though, how that change made it where only some inputs had the issue and all nodes showed up fine in the selector even then, just sometimes not one selected. I would have expected every one to have the issue when there was a problem with that method in the class. Pretty odd, but not worth me going through figuring out why.

    it was probably silently failing inside the node helper, if you don't have php setup to show errors or have overridden it via ini_set or in htaccess. 

  12. 3333.thumb.png.1c14ac345681b3e966e78739010f9004.png

    in my toolbox app, in settings, there is an option for "patch init.php", what this does, will rewrite the monkeypatch method of the init class, to write hooks to a folder and use those instead of eval'ing them, so if there is an error with them, its a proper backtrace instead of a pseudo one thru eval. note: you shouldn't use this on a live site and it can't be used in the community in the cloud, so a localhost or a dev site should suffice. it does modify a core file from IPS, so if you have any unexpected behaviors, you should restore the init.php from the IPS download. 

    you can grab the latest toolbox from this repo: 

    https://github.com/codingjungle/toolbox

    make sure you are on the dev branch when you checkout. 

  13. whyIDEsMatter.thumb.png.f67d1ded8c0dd6739cf491787a5ae2b1.png

    using an IDE with the proxyclass generator, it will tell you when method signatures change from a parent class, here it puts a squiggly line under the method and when i focus on it, it will tell me its no longer compatible with the parent.

    Phpstorm is an excellent IDE, its very reasonably priced (they offer yearly or monthly subscriptions, and they also offer loyalty discounts. after 3 years phpstorm will be as little as $5 a month or around $50 a year. note: i'm not affiliated with jetbrains, i'm just a crazed fanboi of their products).

    if you don't want to pay for one, there are a few opensource free ones like eclipse or VS Code (if you are afraid MS tracking you thru telemetry which VS Code has, you can opt for the VS Codium which removes all that but still remains compatible with VS Code plugins), and if you are really masochistic, there is netbeans and sublime. note: vs code/sublime aren't true IDE's, they are more advanced text editors that thru plugins you can emulate IDE features, netbeans and eclipse are IDE's, but they all vary in ability and features. 

  14. if this for a non-marketplace app, i would load it up thru the interface folder or load it remotely.

    $myJs = \IPS\Output::i()->js('myfolder/myjs.js', 'myapp','interface');
    \IPS\Output::i()->jsFiles = array_merge(\IPS\Output::i()->jsFiles,$myJs);

    or 

    \IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles,[ \IPS\Http\Url::external('http://example.com/something.js') ]);

    if this is for a MP app, you might have to consider the remote loading as an option, since last i heard the the interface folder doesn't work for the cloud communities and i don't think you can you use the bypass method (which would be loading it thru the resources), cause it probably wont be able to properly map the imports (as imports if i am not mistaken are loaded by relative paths and resources wouldn't be relative). 

  15. Sorry guys, has been a crazy time these last few months. I will have a full update on my site if you are interested to read the crazy.

     

    On 1/21/2021 at 7:15 PM, Noble~ said:

    Thanks for the update it seemed to fix the other issues however im now seeing this error on the default theme even after i run the support tool.

    [[Template stratagem/front/projects/controls is throwing an error. This theme may be out of date. Run the support tool in the AdminCP to restore the default theme.]]

    any info on the exact reason why its failing in the system log? there should be a relevant log to it in the acp system log. 

  16. On 1/17/2021 at 9:17 PM, mrcbowers said:

    Getting this error..... There are some problems with your database

    
    ALTER TABLE `core_groups` CHANGE COLUMN `g_stratagem_copy_projects` `g_stratagem_copy_projects` TINYINT UNSIGNED NULL DEFAULT 0 

    i uploaded 2.3.0 last thursday which doesn't add that column. it however doesn't remove it, once you update you can manually remove the column as we aren't allowed to touch the core tables any longer. 

    it actually isn't causing any issues, it just the schema checker isn't very bright, if it doesn't have json entry for it, it flips out. 

×
×
  • Create New...