Jump to content

Adam

Members
  • Posts

    131
  • Joined

  • Last visited

  • Days Won

    16

Everything posted by Adam

  1. A typical "blank page" could be an indication that you have errors and the PHP environment is not configured to display errors. Check your logs, restore from backup. -Adam
  2. Any update on this from the Blesta staff? -Adam
  3. Any update on this from the Blesta staff? -Adam
  4. How does everyone do logging in their custom module and plugin? Does Blesta have some common log controller we can call into? Or does everyone roll their own logging software? I see that CORE-1847 has made it into the next release (4.1). May we assume that modules and plugins will be able to use this? Thanks, -Adam
  5. FYI: Post is from 2015. Blesta already has a license manager in a stable release. https://docs.blesta.com/display/user/License+Manager -Adam
  6. Should take this conversation out of the forums and open a support ticket directly with Blesta (assuming you have an active support and update subscription with them). -Adam
  7. Thanks Paul. That is awesome. Once Blesta 4.1 is release I can release my Cerb (www.cerb.ai) module with Blesta. -Adam
  8. Adam

    Blesta 4 on PHP7

    For development I tried to run PHP 7.1 but IonCube does not support it.. yet. Had to recompile to 7.0. Everything works fine. -Adam
  9. Where are you planning on running this code? In a plugin? In a module? More information here: https://docs.blesta.com/display/dev/Overview -Adam
  10. Er ya, I totally missed that part in your original post. My bad. That is a bit more complicated and would require more changes to get done right -- modify the Blesta Admin GUI to allow admins reorder departments, which would require controller code changes as well as add an extra column to the database schema. No simple one line fix. I would highly recommend and avoid changing the id column in the database. That id is the primary key and used in multiple tables as you noted earlier. The hackiest solution I can think of would be to modify views/default/client_tickets_departments.pdt and hard code the order there. I have not tested this code but something like this should work: 20 $departmentsSorted = array(); 21 foreach ($this->Html->ifSet($departments, []) as $department) { 22 if($department->name == 'Test 2') 23 $departmentedSorted = array_unshift($departmentsSorted,$department); 24 else if($department->name == 'Test 3') 25 $departmentedSorted = array_unshift($departmentsSorted,$department); 26 // All other departments get pushed to the end 27 else 28 $departmentedSorted = array_push($departmentsSorted,$department); 29 } 30 foreach ($this->Html->ifSet($departmentsSorted, []) as $department) { Test 3 is the name of the department and it will be shown first. array_unshift inserts to the front of the list while push inserts to the end. You could also use $department->id which would allow you to change the department name without having to re-do this file. If you are looking for something more complex, then you need to get some custom work done. -Adam
  11. Definitely an original concept. Very neat. -Adam
  12. What ordering do you want? Blesta clients can click on a column and change the order they see. If you want to change the default, take a look at the following settings in support_manager/controllers/client_tickets.php 62 public function index() 63 { 64 $status = (isset($this->get[0]) ? $this->get[0] : 'not_closed'); 65 $page = (isset($this->get[1]) ? (int)$this->get[1] : 1); 66 $sort = (isset($this->get['sort']) ? $this->get['sort'] : 'last_reply_date'); 67 $order = (isset($this->get['order']) ? $this->get['order'] : 'desc'); Lines 66 and 67 is most likely what you are after. The 'last_reply_date' and 'desc' are the default values when a Blesta client does not do manual sorting by clicking on a column header. -Adam
  13. Looking at the source code on GitHub: https://github.com/qlpqlp/Blesta/tree/master/plugins/support_managerpro It appears @PauloV has licensed the software under's Blesta license agreement AND gives all copyright to Phillips Data, Inc. Does not even include himself. http://www.blesta.com/license/ I am no lawyer, but I think @PauloV is breaking the license agreement as he is distributing the software without the written authorization of Phillips Data, Inc. Again, @PauloVchoose that license and why he did is a mystery. One could argue that Phillips Data, Inc. can submit a cease and desist order to GitHub and they would be obligated to remove the code from GitHub. I do not think @PauloV understands much about software licensing. I would assume his intend was to make it available, free of charge, to the community and for them to do what they want with it -- public domain. -Adam
  14. I think the intent was to produce a patch file that you can run from the command line and fill in all the changes automatically, or fail if it can not. However it looks like @Hix posted an diff based on an older RCS format. Creating a diff with the diff -u option would be better and easier to understand, IMO. -Adam
  15. cPanel is not removing the old WHM authentication anytime soon. It will be years, and I mean years, before cPanel fully deprecates the old style key based authentication in favor for the ReST one. This should not be the only reason holding you back on upgrading.
  16. Yes, WHM API 1 (not 0). cPanel has a few SDKs. Their official one is only for XML responses https://github.com/CpanelInc/publicapi-php But they also support JSON. All API functions support XML and JSON. If you look at their confluence page for all SDKs, they provide sample Perl and JSON code. Example: https://documentation.cpanel.net/display/SDK/Guide+to+API+Authentication+-+API+Tokens Here a list of 3rd party cPanel libraries. PHP is included. https://documentation.cpanel.net/display/SDK/Quickstart+Development+Guide+-+Libraries -Adam
  17. Yup. Its in the core of Blesta: app/app_model.php. Alternatively, do not use date('c') but perhaps a timestamp (UNIX/epoch, etc.). One could make the argument to the Blesta guys that they should be checking the errorCode of a PDOStatement->execute within minPHP either in Records class of their PdoConnection class. http://php.net/manual/en/pdostatement.errorinfo.php#refsect1-pdostatement.errorinfo-examples -Adam
  18. Thats because all the core code uses the dateToUtc function: http://source-docs.blesta.com/class-AppModel.html#_dateToUtc The function basically converts: 2017-04-25T14:43:00+00:00 which as you know is ISO 8601 format (date('c')) to something MySQL understands as explained in their documentation: 2017-04-25 14:43:00 -Adam
  19. Not sure if this will help. Try this: Log into PayPal and update your IPN URL (I am assuming you have not): Profile -> Profile and Settings -> My Selling Tools -> Instant payment notifications change the URL to the gateway callback. -Adam
  20. Sorry for the spam, but I am pretty sure I know what is going on. The issue was right in front of us -- the datetime is invalid . You should really be using a timestamp (UNIX/epoch as an example). Blesta uses PDO statements to insert into the database. When you create a PDO connection, you get to set the 'sql_mode'. Blesta's minPHP framework uses the system's default settings. It appears your system does NOT have the following enabled (system wide): SET SQL_MODE='ALLOW_INVALID_DATES'; As mentioned earlier, when Blesta creates a PDO connection, it uses system defaults and not override anything for that session. Why is this important, because PHP's date('c') produces invalid datetime for MySQL. Its explained fairly well in their documentation: https://dev.mysql.com/doc/refman/5.6/en/sql-mode.html#sqlmode_allow_invalid_dates You can see it live from a system I created to reproduce the issue: MariaDB [datetest]> select @@sql_mode; +----------------------------------------------------------------+ | @@sql_mode | +----------------------------------------------------------------+ | STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION | +----------------------------------------------------------------+ 1 row in set (0.00 sec) MariaDB [datetest]> INSERT INTO test (id, col1) VALUES (NULL, '2017-04-25T05:04:57+00:00'); ERROR 1292 (22007): Incorrect datetime value: '2017-04-25T05:04:57+00:00' for column 'col1' at row 1 MariaDB [datetest]> set @@sql_mode='ALLOW_INVALID_DATES'; Query OK, 0 rows affected (0.00 sec) MariaDB [datetest]> INSERT INTO test (id, col1) VALUES (NULL, '2017-04-25T05:04:57+00:00'); Query OK, 1 row affected, 1 warning (0.01 sec) MariaDB [datetest]> show warnings; +---------+------+-------------------------------------------+ | Level | Code | Message | +---------+------+-------------------------------------------+ | Warning | 1265 | Data truncated for column 'col1' at row 1 | +---------+------+-------------------------------------------+ 1 row in set (0.00 sec) MariaDB [datetest]> select * from test; +----+---------------------+ | id | col1 | +----+---------------------+ | 10 | 2017-04-25 05:04:57 | +----+---------------------+ 1 row in set (0.01 sec) MariaDB [datetest]> You will notice that datetime format is different then what we inserted because date('c') from PHP is not accepted by MySQL. Again, issue is with your environment. Tricky to find if you do not have experience. -Adam
  21. Thank you for providing more detailed information like someone else can reproduce the issue.... Please apply the following patch file and let me know the results: diff --git a/announcements/models/announcements.php b/announcements/models/announcements.php index a61adc6..91c7856 100644 --- a/announcements/models/announcements.php +++ b/announcements/models/announcements.php @@ -201,7 +201,13 @@ class Announcements extends AnnouncementsModel { $this->Record->begin(); $fields = array("title", "body", "date_added", "active", "company_id", "public", "permit_client_groups", "permit_packages"); - $this->Record->insert("nh_announcement_news", $vars, $fields); + $pdoStatement = $this->Record->insert("nh_announcement_news", $vars, $fields); + if($pdoStatement instanceof PDOStatement && $pdoStatement->errorCode() !== '00000') { + echo "<pre>"; + print_r($pdoStatement->errorInfo()); + echo "</pre>"; + die(); + } $announcement_id = $this->Record->lastInsertId(); // Add client groups
  22. What MySQL driver are you using with PHP? -Adam
  23. I think what he posted is wrong. It does not make sense. Read my message. Doubt it, seeing how no one else is having issues.. just you... -Adam
  24. Ugh.. That does not make sense. You have a field called "dated_added" but its a serialization of a field called description? If you run a query to find all announcements by date_added or sorted by date_added how does that work? Are you doing it application side -- not having the database do all the work for you? -Adam
  25. Can you make a single PHP file without Blesta or minPHP that Creates the schema Inserts into sql Delete everything Does the problem still exist? This will help narrow if the issue is with minPHP or something else. Please also share the file and I can try and recreate it on my environment. I run CloudLinux and have access to multiple versions of PHP I can help test with. -Adam
×
×
  • Create New...