Skip to content

Releases: Collivery/Opencart

Populate empty config fields

29 Sep 08:11

Choose a tag to compare

Merge remote-tracking branch 'origin/MDS-47'

# Conflicts:
#	collivery.ocmod.zip

Bugfix/Various

22 Sep 06:42
6c9be4c

Choose a tag to compare

  • e91c56e [change] Add the ability to clear the mds cache
    • Useful in case of bugs causing the storing of erroneousdata
  • 6ac6f82 [bugfix] Run all user-provided inputs through $this->db->escape() before composing the sql string
    • It appears that OpenCart doesn't use sql bindings,
    • This replicates what the internal classes seem to be using for queries
  • 3a23f9b [create] Log all backtraces for exceptions in the scope of the plugin to separate files
    • Capture backtraces with some very nice scripts from https://gist.github.com/peterjwest/5459304
      • Allows full objects to be captured and formatted
      • Allows setting a limit on how far you want to nest into objects/arrays
      • Else with a print_r() we dump the entire application state as soon as we hit an instance of Registry
  • 0345f2f [change] Add the ability to download all error logs in a .zip
    • Very useful for helping clients debug
    • Allows users who are not tech-savvy enough to grab a folder through ftp/scp to give us their logs
  • 9123818 [bugfix] Do not attempt to write the logs in the folder that the php file is in
    • Allow for custom path to passed through
  • 851c547 [bugfix] Better display of error messages after redirect
    • Opencart will auto-render $data['success']/$data['error'] in the views
    • But we need to grab that from session in the case of redirects
    • Better formatting of the twig code that displays error/success messages in the admin view
  • d663a33 [bugfix] Use the correct route and params for Url::link()
    • The third param has changed in recent OpenCart versions to a bool
    • The routes previously defined now error out
      • I replicated the routes from the OC default flat shipping code
  • 8ad2335 [bugfix] Prevent attempting to fetch rates if the collivery values are not selected
    • Am unsure whether validating in the same way the (eg) firstname or email are validated is possible
    • This is an acceptable compromise
  • f31a4a6 [bugfix] Prevent NPE if the price is not returned from ModelExtensionShippingMds::getShippingCost()
    • Happens in the case of (eg) validation errors
  • d93a271 [bugfix] Ensure the errors are returned from ModelExtensionShippingMds::getQuote() if there are any
    • The error property is rendered by frontend JS for each shipping method
  • 873ef8f [bugfix|improvement] Vastly improve a dirty hack for registering the Collivery service class in the IOCcontainer
    • Was previously running sql several times per request
    • Muddied up the get() of the base controller
      • Which means it was run every time a $this->... call had to be resolved dynamically in a controller
      • Every new ...Controller in a request lifecycle had to rerun the sql
    • The data that was being queried is already in the Config class
    • The StartupStartupControllers are run on every request, but:
      • It adds no extra sql (data already loaded in Config)
      • Doesn't run this code more than once per request
  • 0aa0e8e [chore] Various doc-block cleanups
  • 54ee07f [bugfix] Do not prefix the Town/Suburb/Location Type data with an <option value=0>Please select...</
    • It is asking for problems when those are actually selected
    • OpenCart already prepends a default selected value
  • e418b35 [change] Bump version number
    • Minor version bump as the changes are vast enough and comprise non-BC changes
    • Hoist the visibility of the value used in the API requests to a constant on the class
      • And add comment to remind the dev to update both definitions (in the install.xml and the Collivery class)
  • eacee69 [change] New .ocmod file
  • fd677fc [bugfix] Do not disable loading of Registry::$collivery if shipping_mds extension is disabled
    • Else we can't open the collivery settings page if the plugin is disabled
  • a66da5e [change] Ensure we refresh cache and the compiled templates on new version uploads
    • In case the data structure of the cached data has changed between versions
    • In case the view template has changed
      • Opencart is terrible with stale cached views
  • bf92a35 [change] Massively simplify the fetching of the data for the collivery settings page
    • Half of that code would never be run due to an early exit on $this->request->server['REQUEST_METHOD']) === 'POST'
    • 90% of the rest is all stored in OC config anyhow
  • b32e7d2 [bugfix] Replace the old SSL param with a boolean in the calls to Url::link()
  • d2caaf2 [bugfix] Ensure changing the default address id works
    • We need to use a key for the setting that starts with our extension's name
      • so default_address_id becomes shipping_mds_default_address_id
      • This is a limitation imposed by opencart
    • Also cache the chosen default address in the collivery code's context
      • This is to make it available without needing to mess with the OpenCart settings classes
  • 8b62929 [bugfix] Ensure the radio form elements render as checked or not
    • The previous logic was broken in so many ways
    • Keep it simple rather than DRY in this case
  • 9804efe [change] Remove unused mdsErrors rendering
    • The variable was previously always set to ''
    • It's now no longer passed from the controller
  • 42711da [change] Allow public access to Collivery::$demoAccount
    • Used to fill the page with a default when no extension settings have been saved before
  • f2e8aa8 [change] New .ocmod file
  • 7567953 [bugfix] Re-add the removed getDefaultAddress() method
    • It's still used
    • The functionality is useful, refactoring out the usages is not the right way to go
  • 55c0365 [change] New zip file
  • 0f557a6 [bugfix] Syntax error when concatenating the sql data
  • 401acda [bugfix] Define missing JS variable
  • 73eb471 [bugfix] Correctly grab the outputted data
  • b7485a3 [change] New zip file
  • 318e36b [bugfix] Handle cases where no error logs exist
  • aefb104 [bugfix] Don't manually set the response content length
    • If the server gzips the response, it'll cause an invalid response
    • Let the webserver deal with it
  • a518a26 [bugfix] Prevent error 500s if the view couldn't load the address data
    • eg invalid login details
  • 82c5b62 [bugfix] Prevent error/success messages persisting as long as the session does.
    • This should really be moved into an event hook
  • e22486b [bugfix] Prevent complete take down of a server if we upgrade from older versions if the plugin
    • In the case of new Collivery class
    • but old modifications/ data
    • In the old version the Collivery was constructed with a config array as input
  • 80017ed [change] Reuse the already defined variables for the cache and logs directory
  • 6deb147 [bugfix] Use the logs directory to create our error logs zip
    • In the case of shared hosting, the /tmp folder won't be writeable
  • 6b52925 [bugfix] Don't return errors where the address is expected
    • Use an empty array and deal with error messages in the consuming code
  • 3ae4a5c [bugfix] Ensure ocmod updates to the view templates are done for all themes
    • not just the default
  • a392824 [bugfix] Add fallbacks in case of the data not existing in the request
    • Else we receive a 500 error
  • f66416f [bugfix] Don't overwrite the pre-existing view data with our own
    • Else things like page_title are overwritten
    • Load it into a sub-key
      • will be a nested instance of Language
  • 5e07e73 [bugfix] typo in accessing the delivery_date response data
  • 08135c0 [change] Remove unused ocmod operation
  • febdee7 [change] New ocmod upload file

Bugfix/various

16 Aug 07:36
43bce44

Choose a tag to compare

  • 0f50ec1 [change] Various clean-ups and logic simplifications
  • c81ba3b [change] Improve auth error message
  • 49da1d9 [change] Delete commented out code
  • a0056ed [bugfix] Better error handling and logging
    • Catch all exceptions within out code
    • Never just die() and echo the error out
    • Do our best to print a stacktrace for better debugging later
  • 7224bd5 [change] Massively simplify logging logic
    • Instead of dancing around whether our Log or opencart's has been provided:
      • just make our compatible with theirs
  • 415d021 [bugfix] Prevent undefined index errors in case no addresses are returned from API
  • 88695b6 [bugfix] Prevent undefined index errors in case no waybill could be booked
    • Create a domain-specific exception and throw it when needed
    • Else an inconsistent return structure is given
  • cffc209 [bugfix] Return the correct data structure from addAddress()
    • The contact_id was previously an array
  • 50ea393 [change] Use only short array syntax
    • Opencart (and this plugin) supports no lower than PHP 5.4
  • 72ffd57 [bugfix] Downgrade and harden the javascript
    • We can't assume that all browsers support ES6 templates and object destructuring
    • Catch ajax errors
      • Use alert() for the time being, no ready-made alert components are available to us
  • d75f2b4 [change] Delete a repeated modification in install.xml
  • ebdbc85 [change] Minor further clean-ups to docblocks
  • 63646a6 [change] Bump version number && new zip file
  • be2e139 [bugfix] Use phpversion() instead of PHP_VERSION_ID
    • PHP_VERSION_ID was only introduced in PHP 7.4
  • d1c8951 [change] Bump minor version number
    • The fixes are vast enough that they don't just constitute a small patch (bugfix) release
    • Rather up the minor (backwards incompatible) version
  • 5292b78 New zip file

Fix rates on front end

15 Jun 13:10
ec71d90

Choose a tag to compare

Merge pull request #18 from webtonic/MDS-19

Mds 19

Default address bug fix

24 May 11:59

Choose a tag to compare

Correctly display the default address on settings page