Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 18    Views: 105

NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
02/01/14 04:59 PM (11 years ago)

Can not save JSON in BTv3 Control Panel- MsgLoc PlugIn

Has anyone else had similar issue with this or other plugin in their BT v3 BT hosted app? Trying to use Smug's Message Location Plugin and can not edit and save any Control Panel JSON item... I have tried renaming the screen nickname, and even deleting and creating a new screen with a different name. Smug is currently not available to work the issue- so that is why I am asking here. Advice from anyone who has been able to edit in CP would be appreciated.- Thanks. Note: iOS7 but believe it is a Control-Panel and Plugin issue not platform.
 
tb
buzztouch Evangelist
Profile
Posts: 2050
Reg: Nov 03, 2011
Oxford
32,300
like
02/01/14 05:46 PM (11 years ago)
It happens to me as well. It will be for sure a Control Panel issue, because it is to do with saving the JSON, not to do with the code.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
02/01/14 06:27 PM (11 years ago)
I have found that changing the name of the plugin (Nickname) seems to help. With respect to JSON information, and adding/changing/keeping json information for a plugin in the control panel, there is really only one way to do it. And it's the way everyone who has created a plugin has done it. I've documented what I could, and Nad has covered the childItems. I'm pretty good with control panel configuration on the back end. I don't think I've made any mistakes there. In fact, I've documented a lot of 'by the way' so that others can smoothly create the control panels for their plugins as well. And when people say 'there is a problem with your plugin', and it concerns the json portion, it's kind of difficult to do anything about a situation beyond our control. The control panel html is pretty standard, and why it works with plugin 'a' and not plugin 'b' is a real stumper. Because other than a few variable names, the methods used to read/write is pretty similar across the board. We can only do what we can do, and after that we depend on a solid infrastructure to drive the results. When a plugin experiences issues, it's natural to suspect a mistake on the side of the plugin. However, when several plugins experience the same issues, and those issues vary from site to site, there isn't much anyone can do but inspect their control panel code, verify it's validity, and hope that the infrastructure solidifies sooner than later. Cheers! -- Smug
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
02/01/14 06:40 PM (11 years ago)
Well said Smug. I would welcome one of our BT Admins to weigh in with a workaround. This would be a good plugin for BT Admin Control Panel resources to test as it happens 100% of the time, and I have not seen it with any of the other 10+ plugins that I have tried so far with BT3. Again- if anyone has it working on BTv3 Control Panel, please let us know. I would be happy to know the solution.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
02/01/14 06:59 PM (11 years ago)
@NCbuzz, do me a favor. In the app you're having issues with, ADD another msgloc screen. Don't worry about tying it to a menu at first; just name it something really odd, like "thisIsATest" or something unique that doesn't come close to your normal naming convention. Then, see if it can save any changes. Let me know if it does or does not. Cheers! -- Smug And of course, it sounds a bit contrived to hear it from the developer, but it geniunely works in my BTv3 control panel. Now, I'm currently working on another plugin that experienced that issue, but I changed the nickname, and I'm ok again.
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
02/01/14 08:31 PM (11 years ago)
Just did a test with this plugin - confirmed the issue. It's not the nickname issue. Here's the error message: A problem occurred while saving the entries (1). The results were not valid JSON. An error ocurred in running the fnExecuteNonQuery() method in utilityFunctions.php (6) There must be something wrong with the control panel configuration. If I get time, I'll take a look at how Smug has it setup to see if I can find where the error is. Could be as simple as an errant comma.
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
02/01/14 08:32 PM (11 years ago)
This should probably be added to buzz-tools.com
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
02/01/14 08:58 PM (11 years ago)
Added to http://www.buzz-tools.com/pluginTracker.php There already was a similar entry for Android
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
02/01/14 09:50 PM (11 years ago)
Well, you know. I'm always willing to help. But until I can reproduce the problem, I'm not entirely sure what else I can do. Some things, within the 'code', no problem. Happy to help when I can. But other than the 'nickname' thing, which affects a few different plugins at odd occasions, I can't get anything to "not" work. I just did this screen recording, adding the plugin into my app, playing with a few controls, and *nothing* went wrong. Before I did the recording, I had an issue with the 'nickname' thing, but I changed it. I figured it would happen again, but it didn't. Nothing went wrong. https://dl.dropboxusercontent.com/u/115208762/sml_cp.mov However, if indeed there 'is' a problem in my control panel, it's possible I fixed it in 'mine' and forgot to include it in an update. I don't 'think' so, but it's possible. In this case, please replace your control panel files (for sw_smugmsgloc) and try these out. If it works, then I'll add them to a new package and update the market. https://dl.dropboxusercontent.com/u/115208762/pluginstuff.zip Cheers! -- Smug Edit: give the movie a minute or two to upload. It's only about 30MB, but it's 30MB from Guam, so it takes a little longer; we're on island time, lol!
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
02/02/14 01:14 AM (11 years ago)
Tested it briefly tonight - doesn't give error on self-hosted, on Buzztouch.com. Not sure why yet. Couldn't get Safari to inject JavaScript to test it out further before I was told to go to bed ;)
 
PSMDanny
Apple Fan
Profile
Posts: 1166
Reg: Dec 09, 2011
Heerlen
21,940
like
02/02/14 01:30 AM (11 years ago)
Hi, Just my two cents. Did not test this plugin but for the one who is having no problems - have a look if there still is an index.php in the folder of the plugin. If it is it takes the index.php and not the html Best Regards, Danny
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
02/02/14 01:34 AM (11 years ago)
Hey, I appreciate the time man. I guess I should have tried BT hosted, but it didn't occur to me. Not sure why, unless somewhere there is a character that one PHP doesn't mind, and another PHP can't stand…? Although they're the same basic php instructions for all plugin/json values. Which values specifically do not work? 4 values (subject, message, arrow image, background image) are specific to the Msg Loc Plugin, but all of the others use the 'built in' BT routines… I'll play around with my BT account and see if I can reproduce the errors… Again, thanks for your time. Sleep well :) Cheers! -- Smug
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
02/02/14 02:15 AM (11 years ago)
It never dawned on me to check the BT hosted control panel. And I just did. I get this error: A problem occurred while saving the entries (1). The results were not valid JSON. An error ocurred in running the fnExecuteNonQuery() method in utilityFunctions.php (6) *regardless* of which value I try to edit. Sadly, I suspect something in the BT Backend, but I'm not sure why "this" plugin works and "that" plugin does not… especially since it seems to work relatively well (universal nickname issues not withstanding) in Self Hosted. Chris can let them know what's going on. I know they're updating code and putting out fires, but I'm not sure at what priority level this can go. I don't want to say the answer is to go self hosted; no one should be forced in that direction. However, I will say that self hosted really provides a lot of freedoms not intrinsically available on BT hosted. However, this issue still needs to be resolved. My 'latest' releases don't utilize an index.php file… If there is one left over in the BT Hosted directory, could that be a culprit? I have no way of looking… Hopefully it can be resolved soon. Cheers! -- Smug
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
03/15/14 06:36 PM (11 years ago)
Well- any word from BT Core on what might be wrong on the backend? Still unable to edit and save JSON... Can someone at BT confirm if there is still an index.php file left over in the BT Hosted directory?
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
03/15/14 09:47 PM (11 years ago)
@mustang -- how to work around this problem: Move the childItems into an hand-edited JSON text file that is hosted within the Files section of the Control Panel. Then configure that Screen to use a dataURL that points to that hand-edited JSON text file. ------- UPDATE ------- That advice will not work for this plugin because it does not have any child items. Instead, the entire bt_config.txt file needs to be hand-edited for that particular screen. Look at the bottom of the plugin's description for the JSON format. You can host that file on a web server, such as the Files area in the Control Panel. Awkward, inconvenient, and a hassle it is. Yet it keeps you going. -- Niraj
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
03/15/14 10:57 PM (11 years ago)
Perhaps Stobe's JSON Snippet keeper would work in this situation? Cheers! -- Smug
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
03/16/14 07:43 AM (11 years ago)
Trying the workaround in configuration data... Well I had been planning on copying several of my screen JSON into snippet keeper, so here is what I tried. What am I missing? == Background info ===== Since the "hideTabBarWhenScreenLoads": "1" has not been working since BTv3 went live, I normally add the following as the last line in any of my screens JSON where I do not want the tab (map screens, smugloc screen, etc: "hideBottomTabBarWhenScreenLoads": "screenId" That is the line I was trying to add in the screen JSON when I found it will not save on the BTv3 Control Panel for the latest SmugMsgLoc. == Tried editing config data === Edited in Configuration tabs both Design and Live. (confirmed that changes shown on each tab) Hitting refresh in APP on iphone showed no change? (Tabbar still visible) Normally I can make a change in CP for a screen and hit refresh in the App and immediately see the change. Did not want to resort to copy paste into BT_config.txt each time ==================================== Note I also saved in SnippetKeeper
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
03/16/14 10:31 AM (11 years ago)
Update: How do you get changes made in CP Design Mode Config file to stay? Went back and noticed that edit changes did not remain there. Is it pulling from Screen data every time and overwriting?
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
03/22/14 08:35 PM (11 years ago)
Could this help anyone? I suspect it could be used for the JSON needed within the BT hosted environment. https://www.youtube.com/watch?v=tycdb94y8Bc&feature=youtu.be It's a video of Stobe using the Json snippet keeper for Plugin development, but the same concept could be used to provide the json needed for a Smug Msg Loc plugin config. Just a thought. Cheers! -- Smug
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.