Acf-core-0.15 Release Notes: Difference between revisions

From Alpine Linux
m (Added category)
(use https links)
 
(One intermediate revision by one other user not shown)
Line 2: Line 2:


== Related bugs / feature requests ==
== Related bugs / feature requests ==
* http://bugs.alpinelinux.org/issues/648 - Standardize ACF form submission
* https://bugs.alpinelinux.org/issues/648 - Standardize ACF form submission
* http://bugs.alpinelinux.org/issues/643 - Upgrade for ACF cli application
* https://bugs.alpinelinux.org/issues/643 - Upgrade for ACF cli application
* http://bugs.alpinelinux.org/issues/642 - Move ACF cli and mvc.lua files
* https://bugs.alpinelinux.org/issues/642 - Move ACF cli and mvc.lua files
* http://bugs.alpinelinux.org/issues/639 - Extend ACF skins to include JS
* https://bugs.alpinelinux.org/issues/639 - Extend ACF skins to include JS


== Scope ==
== Scope ==
Line 12: Line 12:
== Changelog ==
== Changelog ==
* Reorganized mvc.lua and the acf_www and acf_cli controllers to move www-specific things from mvc to acf_www, and visa versa
* Reorganized mvc.lua and the acf_www and acf_cli controllers to move www-specific things from mvc to acf_www, and visa versa
** Templates, skins, and user permissions are www-specific, whereas html output is not
** Templates, [[Alpine ACF Skins|skins]], and user permissions are www-specific, whereas html output is not
** Removed controllerfunctions.lua and moved the handle_form and handle_clientdata functions into mvc.lua with overridden versions in acf_www and acf_cli
** Removed controllerfunctions.lua and moved the handle_form and handle_clientdata functions into mvc.lua with overridden versions in acf_www and acf_cli
** Updated controllers to remove redirect_to_referrer references
** Updated controllers to remove redirect_to_referrer references
Line 31: Line 31:


== Necessary Changes for Custom ACFs ==
== Necessary Changes for Custom ACFs ==
Following is a list of the changes necessary for custom ACF packages to work with acf-core-0.15. The best way to understand the changes is to look at the changes made to ACF packages in the public [http://git.alpinelinux.org git repo]. If you have further questions, you can use the ACF [[Mailing_lists | mailing list]].
Following is a list of the changes necessary for custom ACF packages to work with acf-core-0.15. The best way to understand the changes is to look at the changes made to ACF packages in the public [https://git.alpinelinux.org git repo]. If you have further questions, you can use the ACF [[Mailing_lists | mailing list]].
=== Views ===
=== Views ===
* Remove all viewfunctions references and replace with htmlviewfunctions (likely need to add references as it is now a module).
* Remove all viewfunctions references and replace with htmlviewfunctions (likely need to add references as it is now a module).

Latest revision as of 02:20, 25 August 2023

For the 0.15 release, found in Alpine Linux 2.5, acf-core had some significant changes that required changes to each and every ACF package. If you have created custom ACF packages for your use, you must make corresponding changes for your code to work on Alpine Linux 2.5.

Related bugs / feature requests

Scope

The major purpose for the changes in acf-core-0.15 was to make a cleaner separation between ACF functionality and the web (www) interface. ACF already included acf_www-controller.lua and acf_cli-controller.lua files, ostensibly to allow the web interface and client interface to separate out their functionality. However, in practice, the www-specific code was scattered everywhere. This separation allows ACF to be used by Lua code as a library and makes an enhanced cli application possible.

Changelog

  • Reorganized mvc.lua and the acf_www and acf_cli controllers to move www-specific things from mvc to acf_www, and visa versa
    • Templates, skins, and user permissions are www-specific, whereas html output is not
    • Removed controllerfunctions.lua and moved the handle_form and handle_clientdata functions into mvc.lua with overridden versions in acf_www and acf_cli
    • Updated controllers to remove redirect_to_referrer references
  • Changed forms to always use 'submit' as the name of the submit button, plus allow multiple submit buttons
    • Changed startstop to be a standard form by creating two model functions and deleting the special controller function
    • Changed handle_form to pass self, clientdata, and action into get_function and self into set_function
  • Added auto_view functionality for html, json, stream, and serialized viewtype
    • Renamed ajax viewtype to json to be more accurate
    • Templates (for www) now receive a viewfunc, rather than using viewfile
    • Actions without views with viewtype of html, json, stream, or serialized will now be displayed using standard code.
    • Allowed viewtype override in clientdata in mvc
  • Removed access to the public APP variable
    • Required modelfunctions.lua setfiledetails and write_file_with_audit to take self parameter
  • Moved viewfunctions.lua to htmlviewfunctions.lua and made it an actual module
  • Removed the public variable auth from authenticator.lua and replaced it with get_subauth function
  • Added option to have skin-specific javascript and/or template in skindir
  • Added clientdata.skinned option to turn off skins in html template

Necessary Changes for Custom ACFs

Following is a list of the changes necessary for custom ACF packages to work with acf-core-0.15. The best way to understand the changes is to look at the changes made to ACF packages in the public git repo. If you have further questions, you can use the ACF mailing list.

Views

  • Remove all viewfunctions references and replace with htmlviewfunctions (likely need to add references as it is now a module).
  • Custom forms must now name the submit button "submit" rather than with the label value.
  • Add 'html = require("acf.html")' if using html library.
  • Many views may be deleted and handled by the auto_view functionality
    • Common things like readonly, password or hidden type, and field order may now be configured in the model get_function.

Controllers

  • Remove all controllerfunctions references and replace with self.
  • Startstop is now handled as a standard form.
  • Remove all self:redirect_to_referrer references and replace with self.handle_form. This will also mean rewriting the corresponding model function to change to two functions creating and using a form.
  • Modify any custom handle_form get or set functions to accept self as the first parameter (they may also be removed and implemented in the model).
  • Remove code that sets viewtype, as this can now be set directly by the user.

Models

  • Form get_function and set_function now receive different parameters: get_function(self, clientdata, action) set_function(self, form)
  • Replace startstop_service with two functions to now handle as standard form.
  • modelfunctions.setfiledetails now takes self as the first parameter