Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted January 6, 20214 yr I have this file "applications\abc\dev\js\admin\controllers\configuration\ips.configuration.form.js" which I load via $form = new Form('form', 'save', NULL, array('data-controller' => 'abc.admin.configuration.form')); Now I face some problems: 1. When I turn off dev mode, the file doesn't load at all. 2. Sometime it loads, but it keep showing the old cached version. 3. I compile it and then create a new version. After that, I upgrade the production with the new archive. But production doesn't load the JS at all. I have to enable dev mode in production, compile JS, and clear cache in support page several times, and then it works. How to fix this strange behavior?
January 6, 20214 yr You have to ensure the js is loaded. In your controller you do something like this, adjusting the filename as appropriate. \IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js('front_browse.js', 'gallery' ) ); Here you'd change "browse" to the javascript controller location, and "gallery" to your application key.
January 11, 20214 yr Author @bfarber I have tried that, but still JS resources doesn't load in production when upgraded.
January 11, 20214 yr What line did you add to your controller generating the page, exactly? What is the controller name, and what is the path to the javascript controller you are attempting to add?