Zon Core merge requestshttps://git.customd.com/custom-d/zon-core/-/merge_requests2018-12-18T15:06:34+13:00https://git.customd.com/custom-d/zon-core/-/merge_requests/152Accounts Sync with Multiple Databases2018-12-18T15:06:34+13:00Phil TaylorAccounts Sync with Multiple Databases## Done:
+ Added functionality to sync user account details to multiple databases
+ Added config to define which databases to sync to
## Notes:
+ Implements in https://git.customd.com/dandi/pulse/merge_requests/393
## Test:
1. ...## Done:
+ Added functionality to sync user account details to multiple databases
+ Added config to define which databases to sync to
## Notes:
+ Implements in https://git.customd.com/dandi/pulse/merge_requests/393
## Test:
1. Log in and go to the account admin area (https://www.zon.dev/admin/accounts/users)
1. Edit your account. Make some changes and confirm it works as you'd expect.
1. Jump into your database and duplicate the entire database with a new name.
1. Update your database config `config/dev-sam/database.php`, copy the existing and paste it as a second database config. Give it a new key and confirm the database name is updated.
1. Copy the `config/accounts.php` file and paste it into your config directory - `config/dev-sam/accounts.php`.
1. Edit the `config/dev-sam/accounts.php` file and add the new database config key to the `extra_databases` config parameter.
1. Repeat steps 1 to 2
1. Check the `bitauth_userdata` in both databases and config the changes have been saved into both.Sam SehnertSam Sehnerthttps://git.customd.com/custom-d/zon-core/-/merge_requests/195Configure Renovate2024-03-29T02:06:24+13:00Craig SmithConfigure RenovateWelcome to [Renovate](https://github.com/renovatebot/renovate)! This is an onboarding MR to help you understand and configure settings before regular Merge Requests begin.
🚦 Renovate will begin keeping your dependencies up-to-date only ...Welcome to [Renovate](https://github.com/renovatebot/renovate)! This is an onboarding MR to help you understand and configure settings before regular Merge Requests begin.
🚦 Renovate will begin keeping your dependencies up-to-date only once you merge or close this Merge Request.
---
### Detected Package Files
* `composer.json` (composer)
* `libraries/oauth/composer.json` (composer)
* `assets/js/plugins/mustache/package.json` (npm)
* `package.json` (npm)
### Configuration Summary
Based on the default config's presets, Renovate will:
- Start dependency updates only once this onboarding MR is merged
- Enable Renovate Dependency Dashboard creation.
- Use semantic commit type `fix` for dependencies and `chore` for all others if semantic commits are in use.
- Ignore `node_modules`, `bower_components`, `vendor` and various test/tests directories.
- Group known monorepo packages together.
- Use curated list of recommended non-monorepo package groupings.
- Apply crowd-sourced package replacement rules.
- Apply crowd-sourced workarounds for known problems with packages.
🔡 Would you like to change the way Renovate is upgrading your dependencies? Simply edit the `renovate.json` in this branch with your custom config and the list of Merge Requests in the "What to Expect" section below will be updated the next time Renovate runs.
---
### What to Expect
With your current configuration, Renovate will create 20 Merge Requests:
<details>
<summary>chore(deps): update dependency phpunit/php-invoker to v2.0.1</summary>
- Schedule: ["at any time"]
- Branch name: `renovate/phpunit-php-invoker-2.x-lockfile`
- Merge into: `master`
- Upgrade [phpunit/php-invoker](https://github.com/sebastianbergmann/php-invoker) to `2.0.1`
</details>
<details>
<summary>fix(deps): update dependency google/apiclient to v1.1.9</summary>
- Schedule: ["at any time"]
- Branch name: `renovate/google-apiclient-1.x-lockfile`
- Merge into: `master`
- Upgrade [google/apiclient](https://github.com/googleapis/google-api-php-client) to `1.1.9`
</details>
<details>
<summary>chore(deps): update dependency grunt-bower-task to ^0.6.0</summary>
- Schedule: ["at any time"]
- Branch name: `renovate/grunt-bower-task-0.x`
- Merge into: `master`
- Upgrade [grunt-bower-task](https://github.com/yatskevich/grunt-bower-task) to `^0.6.0`
</details>
<details>
<summary>chore(deps): update dependency mocha to v1.21.5</summary>
- Schedule: ["at any time"]
- Branch name: `renovate/mocha-1.x`
- Merge into: `master`
- Upgrade [mocha](https://github.com/mochajs/mocha) to `1.21.5`
</details>
<details>
<summary>fix(deps): update dependency airmoi/filemaker to ~2.5.0</summary>
- Schedule: ["at any time"]
- Branch name: `renovate/airmoi-filemaker-2.x`
- Merge into: `master`
- Upgrade [airmoi/filemaker](https://github.com/airmoi/FileMaker) to `~2.5.0`
</details>
<details>
<summary>fix(deps): update dependency guzzlehttp/guzzle to v6.5.8</summary>
- Schedule: ["at any time"]
- Branch name: `renovate/guzzlehttp-guzzle-6.x-lockfile`
- Merge into: `master`
- Upgrade [guzzlehttp/guzzle](https://github.com/guzzle/guzzle) to `6.5.8`
</details>
<details>
<summary>chore(deps): update dependency grunt to v1</summary>
- Schedule: ["at any time"]
- Branch name: `renovate/grunt-1.x`
- Merge into: `master`
- Upgrade [grunt](https://github.com/gruntjs/grunt) to `^1.0.0`
</details>
<details>
<summary>chore(deps): update dependency grunt-contrib-copy to v1</summary>
- Schedule: ["at any time"]
- Branch name: `renovate/grunt-contrib-copy-1.x`
- Merge into: `master`
- Upgrade [grunt-contrib-copy](https://github.com/gruntjs/grunt-contrib-copy) to `^1.0.0`
</details>
<details>
<summary>chore(deps): update dependency grunt-contrib-symlink to v1</summary>
- Schedule: ["at any time"]
- Branch name: `renovate/grunt-contrib-symlink-1.x`
- Merge into: `master`
- Upgrade [grunt-contrib-symlink](https://github.com/gruntjs/grunt-contrib-symlink) to `^1.0.0`
</details>
<details>
<summary>chore(deps): update dependency grunt-contrib-watch to v1</summary>
- Schedule: ["at any time"]
- Branch name: `renovate/grunt-contrib-watch-1.x`
- Merge into: `master`
- Upgrade [grunt-contrib-watch](https://github.com/gruntjs/grunt-contrib-watch) to `~1.1.0`
</details>
<details>
<summary>chore(deps): update dependency grunt-mkdir to v1</summary>
- Schedule: ["at any time"]
- Branch name: `renovate/grunt-mkdir-1.x`
- Merge into: `master`
- Upgrade [grunt-mkdir](https://github.com/rubenv/grunt-mkdir) to `^1.0.0`
</details>
<details>
<summary>chore(deps): update dependency grunt-sass to v3</summary>
- Schedule: ["at any time"]
- Branch name: `renovate/grunt-sass-3.x`
- Merge into: `master`
- Upgrade [grunt-sass](https://github.com/sindresorhus/grunt-sass) to `^3.0.0`
</details>
<details>
<summary>chore(deps): update dependency grunt-shell to v4</summary>
- Schedule: ["at any time"]
- Branch name: `renovate/grunt-shell-4.x`
- Merge into: `master`
- Upgrade [grunt-shell](https://github.com/sindresorhus/grunt-shell) to `^4.0.0`
</details>
<details>
<summary>chore(deps): update dependency mocha to v10</summary>
- Schedule: ["at any time"]
- Branch name: `renovate/mocha-10.x`
- Merge into: `master`
- Upgrade [mocha](https://github.com/mochajs/mocha) to `10.4.0`
</details>
<details>
<summary>chore(deps): update dependency phpunit/dbunit to v4</summary>
- Schedule: ["at any time"]
- Branch name: `renovate/phpunit-dbunit-4.x-lockfile`
- Merge into: `master`
- Upgrade [phpunit/dbunit](https://github.com/sebastianbergmann/dbunit) to `4.0.0`
</details>
<details>
<summary>chore(deps): update dependency phpunit/php-invoker to v5</summary>
- Schedule: ["at any time"]
- Branch name: `renovate/phpunit-php-invoker-5.x-lockfile`
- Merge into: `master`
- Upgrade [phpunit/php-invoker](https://github.com/sebastianbergmann/php-invoker) to `5.0.0`
</details>
<details>
<summary>chore(deps): update dependency phpunit/phpunit to v11</summary>
- Schedule: ["at any time"]
- Branch name: `renovate/phpunit-phpunit-11.x`
- Merge into: `master`
- Upgrade [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) to `~11.0.0`
</details>
<details>
<summary>fix(deps): update dependency google/apiclient to v2</summary>
- Schedule: ["at any time"]
- Branch name: `renovate/google-apiclient-2.x`
- Merge into: `master`
- Upgrade [google/apiclient](https://github.com/googleapis/google-api-php-client) to `~2.15.0`
</details>
<details>
<summary>fix(deps): update dependency guzzlehttp/guzzle to v7</summary>
- Schedule: ["at any time"]
- Branch name: `renovate/guzzlehttp-guzzle-7.x`
- Merge into: `master`
- Upgrade [guzzlehttp/guzzle](https://github.com/guzzle/guzzle) to `~7.0`
</details>
<details>
<summary>fix(deps): update dependency zordius/lightncandy to v1</summary>
- Schedule: ["at any time"]
- Branch name: `renovate/zordius-lightncandy-1.x`
- Merge into: `master`
- Upgrade [zordius/lightncandy](https://github.com/zordius/lightncandy) to `~1.0`
</details>
---
âť“ Got questions? Check out Renovate's [Docs](https://docs.renovatebot.com/), particularly the Getting Started section.
If you need any further assistance then you can also [request help here](https://github.com/renovatebot/renovate/discussions).
---
This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).https://git.customd.com/custom-d/zon-core/-/merge_requests/192WIP: Improvements to error handling in queueing library2020-07-16T15:54:24+12:00Robert SintonWIP: Improvements to error handling in queueing library## Background
In various projects, I've occasionally run into problems when queue jobs failed but didn't return a JSON-encoded response, or Exceptions were thrown outside of the Guzzle call context.
## What I did
+ Explicitly catc...## Background
In various projects, I've occasionally run into problems when queue jobs failed but didn't return a JSON-encoded response, or Exceptions were thrown outside of the Guzzle call context.
## What I did
+ Explicitly catch and handle Guzzle exceptions that indicate a genuine 4xx or 5xx response.
+ Extract the response body as a string if turns out not to be a JSON object.
+ Handle other Exceptions separately, to give the best chance of recording a meaningful error message in the log.
## Implications
None
## Setup
None
## How to test
+ Code review
+ Pick a queue jobs and get it to output an error with a straight string message; observe that this is now reported better in the queue log.
+ Try and break it!https://git.customd.com/custom-d/zon-core/-/merge_requests/189Tps laravel Auth2021-04-12T21:21:10+12:00Craig SmithTps laravel AuthMigrates auth to use Laravel Authentication,
Test in tandem with the tps Code igniter updateMigrates auth to use Laravel Authentication,
Test in tandem with the tps Code igniter updateSam SehnertSam Sehnerthttps://git.customd.com/custom-d/zon-core/-/merge_requests/174Feature/xero if modified since2019-07-15T16:02:14+12:00Robert SintonFeature/xero if modified sinceThe Xero API allows for fetching items created or modified after a certain date by using the HTTP If-Modified-Since header. This change allows for easy use of that, including in a call chain, without having to separately set a header.
#...The Xero API allows for fetching items created or modified after a certain date by using the HTTP If-Modified-Since header. This change allows for easy use of that, including in a call chain, without having to separately set a header.
## What I did
+ Added parameter specifications to the get() method definition in the DF_Xero_Public class, to avoid a PHP warning about it not matching the signature of the method from the DF_Xero class that it overloads.
+ Added an if_modified_since() utility method to DF_Xero, to allow for the common case of requesting items modified since a specified time.
## Implications
None
## Setup
None
## How to test
+ Code review.
+ Can be tested with commit `104de2357cfcaaec87c4f858054e4819cbdafbcb` from the National Weighing project
+ Different results can be viewed with these URLs:
+ https://www.nw.vm/xero_inventory/modified_since/2019-05-09T00:00:00
+ https://www.nw.vm/xero_inventory/modified_since/2019-05-10T00:00:00Sam SehnertSam Sehnerthttps://git.customd.com/custom-d/zon-core/-/merge_requests/169WIP: DF_Model result classes — shortcut for triggering exception-throwing whe...2020-01-21T18:14:59+13:00Robert SintonWIP: DF_Model result classes — shortcut for triggering exception-throwing when saving## TO DO
Currently conflicted with `master` — only due to use of v 1.8.2 for a different change in **DF_Model_result.php**. Merged and resolve when ready to review.
## What I did
+ Added an error_class option to DF_Model_result's ...## TO DO
Currently conflicted with `master` — only due to use of v 1.8.2 for a different change in **DF_Model_result.php**. Merged and resolve when ready to review.
## What I did
+ Added an error_class option to DF_Model_result's save() method.
## Implications
This change makes it much easier to produce mock objects with their database-saving behaviour mocked out, when we want exception-throwing behaviour from DF_Model.
Currently, we need to write code like this in order to trigger exception throwing if something goes wrong while saving (unless the model itself is set to always throw exceptions, but that is very rare — much more common to be adding calls like this with legacy models):
```
$object->use_error_class()->save();
```
When writing unit tests that use mock objects to test code that includes calls like the above, we need to manufacture mock objects where not only `save()` is mocked out, but _also_ where `use_error_class()` is mocked to return an object that behaves properly in this chain, i.e. returns a mock object that can have `save()` called on it.
With this change, we can save objects like with this simple call:
```
$object->save(true);
```
Where the parameter indicates that we want exception-throwing behaviour. `true` will throw the default exception class for that object or DF_Model, or we can pass the name of an exception class that we want thrown.
Then when writing unit tests, the mock objects just needs to have `save()` mocked to return null.
## Setup
None
## How to test
+ Code review
+ Having trouble finding a way to test this in practice; will leave as WIP for now.Sam SehnertSam Sehnerthttps://git.customd.com/custom-d/zon-core/-/merge_requests/166PHPUnit testing bootstrap improvements2020-06-22T16:50:43+12:00Sam SehnertPHPUnit testing bootstrap improvements## What I Did
+ [x] Don’t redirect when migrations are out of date for unit tests
+ [x] Don’t use database sessions when running unit tests
+ [x] Throw a `PHPUnit_Framework_Exception` instead of redirecting so you can track why PHPUnit s...## What I Did
+ [x] Don’t redirect when migrations are out of date for unit tests
+ [x] Don’t use database sessions when running unit tests
+ [x] Throw a `PHPUnit_Framework_Exception` instead of redirecting so you can track why PHPUnit silently stopped executing
## Implications
It's possible that someone might want to legitimately test that the redirect function was called. I'm not sure & haven't tested how this might work, but there may be a way to mock the redirect function or something. In any case, you wouldn't be cant test the redirect function in this way without something similar even before this patch.
## Testing
Easiest way to test is against the AFES PHPUnit tests: `feature/unit_testing`. Completely empty the `afes_unit_testing` database and try run the unit tests. Before this patch, this would silently fail.
+ [ ] Ensure that the unit tests populate the database and complete successfully
+ [ ] Add a test with a call to `redirect` and check that execution stops, but prints an `Warning` to the terminal.Sam SehnertSam Sehnerthttps://git.customd.com/custom-d/zon-core/-/merge_requests/143DF_Model Ordering2021-09-05T08:40:28+12:00Phil TaylorDF_Model Ordering# Done:
+ Removed "order" as a default column to sort on, as it’s not a standard column we have in all tables
+ Added a get_published_order method to add table name on each order column so queries don't result in an ambiguous error when ...# Done:
+ Removed "order" as a default column to sort on, as it’s not a standard column we have in all tables
+ Added a get_published_order method to add table name on each order column so queries don't result in an ambiguous error when a fetch includes a join
+ Improved the order_by method to handle "COALESCE" orders
+ Removed duplicate order code within the get_where method in favour for the order_by method
# Testing:
1. Login as an admin and navigate to the accounts screen
1. Confirm the sort and search works correctlyPhil TaylorPhil Taylorhttps://git.customd.com/custom-d/zon-core/-/merge_requests/141Feature/php 7.32021-11-15T12:21:52+13:00Craig SmithFeature/php 7.3## What I did
+ Updated Zon core to PHP7.3 compatability
+ updated phpunit to version 8
## Note
+ taken from the current zon branch for pulse
## Migration Notes
+ FileMaker Library has been removed (https://github.com/msyk/FMDataAPI /...## What I did
+ Updated Zon core to PHP7.3 compatability
+ updated phpunit to version 8
## Note
+ taken from the current zon branch for pulse
## Migration Notes
+ FileMaker Library has been removed (https://github.com/msyk/FMDataAPI / https://github.com/airmoi/FileMaker )
+ Curl library is no longer in use - use Guzzle rather (http://docs.guzzlephp.org/en/stable/quickstart.html)https://git.customd.com/custom-d/zon-core/-/merge_requests/133WIP: analytics v2 support2018-05-17T16:38:25+12:00Craig SmithWIP: analytics v2 supportUpdated to support either version of analytics:
For version 2 you will need to follow the setup instructions for the json file here:
https://developers.google.com/analytics/devguides/reporting/core/v3/quickstart/service-phpUpdated to support either version of analytics:
For version 2 you will need to follow the setup instructions for the json file here:
https://developers.google.com/analytics/devguides/reporting/core/v3/quickstart/service-phphttps://git.customd.com/custom-d/zon-core/-/merge_requests/96WIP: AMS / Content Managment system2018-07-27T08:30:49+12:00Craig SmithWIP: AMS / Content Managment system# Asset Managment System for Content Management
## What I did
+ Implemented new core module to handle content items - simply by designing the data structure and implementing a front-end view
## Implications
N/A
## Setup
+ Migration t...# Asset Managment System for Content Management
## What I did
+ Implemented new core module to handle content items - simply by designing the data structure and implementing a front-end view
## Implications
N/A
## Setup
+ Migration to add the datastore tables
+ .htaccess rewrite rule remove the robots.txt from exclude list (as is now managed in the admin)
+ add to the routes config file:
$route['ams/(:any)'] = "ams/index/$1";
$route['robots.txt'] = "ams/robots";
+ add to site config file
$config['modules']['ams'] = TRUE;
## How to test
+ Admin area now has a new menu option: Content Items
- content list - allows you to list current content items
- add content - allows you to add a new content item
- manage pages - allows you to create a publicly visible pageSam SehnertSam Sehnert