Jump to content

EmptyMind

Members
  • Posts

    26
  • Joined

  • Last visited

Recent Profile Visitors

950 profile views

EmptyMind's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I'm using the 'blesta api' class as '$this->blesta' here is a quick 'cut' of the code at play: function savenewcc($vars) { print_r($vars); $response = $this->blesta->post('Accounts','addCc',array('vars' => $vars)); print_r($response); } Here is the output showing the $vars going in and the response object after the call. Array ( [contact_id] => 1 [first_name] => asdf [last_name] => asdf [number] => 4111111111111111 [cvv] => 123 [expiration] => 201401 ) BlestaResponse Object ( [raw:BlestaResponse:private] => {"message":"An unexpected error occured.","response":"Undefined property: stdClass::$address1"} [response_code:BlestaResponse:private] => 500 ) Adding the optional fields suppresses this error and the card is saved. I'm not submitting anything that relates to 'address1' in this case. The only reference to 'address1' that I can find in the logic path is: app/models/accounts.php ~ line 492 $fields = array( "contact_id", "first_name", "last_name", "address1", "address2", "city", "state", "zip", "country", "number", "expiration", "last4", "type", "gateway_id", "client_reference_id", "reference_id" ); $this->Record->insert("accounts_cc", $vars, $fields); --- Perhaps with the record insert code not being able to find the matching indexes in the vars, if they were not sent. As in my code example above. Can't say for sure. Although the 'contacts' add code looks the same and doesn't give the same error performing the same function the same way. this is with Blesta 3.0.6. Additionally (this maybe SHOULD be a separate report but since im here, and its sorta related) There is a minor flaw in the 'optional field' logic. ( I believe this affects the 'contacts' as well. ) The 'country' and 'state' fields are listed as optional. The country field DEFAULTS to 'US' if its not set to anything (Don't get me started on THAT.), the problem is that the 'state' rule is only optional if the COUNTRY is blank. As soon as 'country' is set it REQUIRES that the 'state' be set to an acceptable state (as per the ISO check you make). This compounds so that if no country is set, its set to US by default.. which then REQUIRES that the state be filled in.. by default. I believe my solution to this when I was working in 'contacts' was to 'trim out' ('unset()') the 'blank' fields before sending the $vars to the api. Thus 'non-existent' is seemingly not the same as 'blank' there. However this same workaround appears to have negative effects here, and I'm scratching my head as to why. At any rate, the addCc function should not be outputting an error when the cc as defined above is submitted. (Sorry, you got me started. Defaulting an 'optional' field to a setting such as 'US' is a bit.. wonky.. I mean.. if you are allowing to NOT set an address.. why would you FORCE a country to be set? makes no sense, especially given that not everyone lives in the 'US' (surprising.. I know). Either force an address to be entered, or don't. Anything else is just silly.)
  2. While using the API I've come across, what may not be a bug.. per se.. but it should certainly be changed. When adding a new contact using the API, the DEFAULT 'contact-type' is set to 'primary'. So if you make the call and 'forget' to set the 'contact-type' (which in the docs is listed as 'optional' btw), the contact is set to 'contact-type' = 'primary'. Now this is where the problems start to occur. The API call for 'DELETE' contact REFUSES to delete a 'primary' contact, making the assumption of course that there is only ONE. Additionally the additional primary contacts appear to cause further issues in pulling up the services list as the call pulls up a service for each contact thats marked primary in the array, even though its the same service. I assume this is due to the way the 'get service list' sql is written. This problem also cascades into blesta proper, where the 'clients' list actually shows additional CLIENTS with the same ID, but different names, corresponding to the additional primary contacts. Also affected appear to be the support ticket list (showing multiple copies of the same ticket). In the blesta client portal the 'delete contact' function returns the same 'cannot delete primary' obviously, since its referencing the same code as the api, thus leaving the only way to 'clean-up' the error being directly editing the database and removing the 'erroneous' entries. I can work around this on my end for now. But this should probably be addressed in the model. Similar to the DELETE function refusing to remove the primary contact, The ADD function should refuse to add more than 1 primary contact, I'd also suggest changing the 'default' for ADD contact, to something other than 'primary', perhaps 'other' would be a better default?. Alternatively, the other functions should be checked to ensure that they work with multiple primary contacts, and the delete function should only refuse to remove the LAST 'primary' contact. Initially tested against 3.0.2, updated to 3.0.6 to verify that the issues still exist. (they do) James
  3. Just for my reference.. is this going to be overwritten during updates?
  4. I understand the need for a 'reasonable' session timeout but I don't want to have to re-login 10 times a day either. (Especially annoying with OTP enabled) Is there a way that I can increase the session timeout from the default? At least for the admin side? I can see clients not needing more than 30 minutes of inactivity.. but us admins.. we are in there all day.. every day.. going back and forth between working on stuff and dealing with clients.. I'd like to have a little more leeway (Especially during development). Currently I go and work on something else for a little while.. an hour.. for example.. go back to test what I'm working on.. re-login required. Quite annoying. I can see the sessions table updating with every access, updating it to +30Mins.
  5. OK, So now that I've tracked down that its the 'provision pending services' task thats 'failing' (without any notice thereof anywhere else), How do I find out.. WHY. Especially given that, this instance is not yet 'live' and there are NO active services. :| OK, so i found one 'pending' service. A test shared account which was set up prior to my enabling the cron, and the test server no longer is active, so it is continually trying to setup the account on a now non-existent server. Perhaps you should think about a quick 'status' check on the 'view cron tasks' page. If you have detected a problem, one should not require going into the mysql databases to determine what it is. Marking the 'run time' in red with a status that it did not finish correctly, for example. Also, if a task is failing, perhaps having that information available.. you know.. an error entry like 'Error provisioning service id <num>: 'server not found'' or something somewhere that could be referenced? I've currently deleted the 'pending service'. DO I need to manually delete the rows in the log as referenced above to clear that error? Or will it now autocorrect? James Edited for clarity.
  6. I get this notice on the dashboard. It's just always there. Cron runs, the View Tasks list appears that everything is running correctly. There is no 'long running' cron process, or orphaned php processes running on the server. Is there a log that this is checking and something is out of sync. What information is this reading? How can I 'reset' the rogue entry correctly to remove this notice. James
  7. aha! $this->view->setView(null, "FeedReader.default"); return $this->partial("admin_manage_plugin", $vars) the examples are missing the 'setView()' to set the view directory.
  8. Forget to mention we are running b5 (haven't updated to b6 yet)
  9. I've gotten to the part of my new plugin, where it would be nice to use the manage interface to set a few fields. However I'm running into the problem of blesta trying to load the views pages from the admin view directory, instead of the plugin's view directory. Taken straight from the plugin how-tp docs.. the command: $this->partial("admin_manage_plugin"); In the index() functoin of the 'AdminManagePlugin' controller returns the following error: --- Oh noes!Files does not exist: /home/blesta/htdocs/app/views/admin/default/admin_manage_plugin.pdt on line 120 in /home/blesta/htdocs/lib/view.php --- Even though the plugin docs says that the view file SHOULD be loaded from the plugin/<pluginname>/view/default/ directory as per: http://docs.blesta.com/display/dev/Creating+a+Plugin at the area headed by 'Managing a Plugin'. Are the docs missing a 'set view directory' command? Or something?
  10. Just a heads up, in 'How to make a plugin' documentation, there is no mention of the 'structure.pdt' file. Or its required presence. nor it's recommended contents Stealing the contents from the support module 'sorta' works.. but now the 'widget' is a full screen, and no blesta.. :| Using the example's provide in the docs was.. ack!.. lol.. Had to kinda.. stitch together a few calls from the supportmanager plugin to get what I expected.. Using the setting as per the example in the docs: $this->structure->view = "default"; Gave the 'structure.pdt missing error. Replacing it with the structure.pdt from the support doc, gave me a full screen view, bypassing all the blesta display. from the support manager admin_tickets controller i found this setting: $this->structure->setDefaultView(APPDIR); Which appears to put back blesta if I replace the previous entry, and puts the widget in the work area that is expected. I'm sure that there is more going on behind the scenes that pertains to this 'structure' setting. But its not documented anywhere that I can find. James
  11. EmptyMind

    Ajax

    Thanks as always Tyson, we'll give those a shot.
  12. EmptyMind

    Ajax

    Hey Guys, quick question. For module 'manage' tabs, we are running into 2 issues hopefully you can point us in the right direction. 1) CSS, Since the tab switching is done via an ajax 'replacer' call, there is no way to 'inject' the css into the header of the page in the tab function. Where would be the 'right place' to load up the css for the module? (Doing it all inline really sucks). 2) AJAX.. is there a place or method of calling that we can use to properly call ajax, so that our functions can still access 'blesta' but so that blesta will just allow the code to run, and output the json back to the javascript without messing about with it. Kinda like the 'tab switching'. James
  13. The view code is already there.. (cut from app/views/admin/default/message.pdt) --- <section class="error_section"> <?php // $success is an alias for $message if (isset($success)) $message = $success; if (isset($message)) { ?> <article class="error_box"> --- I just want to be able to set '$success' for the view to display from my module widget. Adding this code: $this->Input->setErrors(array('test' => array('info' => "An unknown error has occured" ))); In my module widget code, causes the red error box to pop up with the error message. I'm looking for the bit that would allow me to set a 'Success' message which appears in Green with a checkmark. (as per the code above) and can be seen for example by adding a service to a user or Successfully updating the service entries or the like.
  14. EmptyMind

    $Success

    Quick one off question. How would one set the '$success' array that is referenced in message.pdt to provide the green 'info box'? Input->setErrors() is used to set the $errors array for the red box.
×
×
  • Create New...