mirror of
https://github.com/cypht-org/cypht.git
synced 2026-04-25 04:56:03 +03:00
[GH-ISSUE #236] Override functions in modules #197
Labels
No labels
2fa
I18N
PGP
Security
Security
account
advanced_search
advanced_search
announcement
api_login
authentication
awaiting feedback
blocker
bug
bug
bug
calendar
config
contacts
core
core
devops
docker
docs
duplicate
dynamic_login
enhancement
epic
feature
feeds
framework
github
github
gmail_contacts
good first issue
help wanted
history
history
imap
imap_folders
inline_message
installation
keyboard_shortcuts
keyboard_shortcuts
ldap_contacts
mobile
need-ssh-access
new module set
nux
pop3
profiles
pull-request
question
refactor
release
research
saved_searches
smtp
strategic
tags
tests
themes
website
wordpress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/cypht#197
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jasonmunro on GitHub (Dec 4, 2017).
Original GitHub issue: https://github.com/cypht-org/cypht/issues/236
Originally assigned to: @jasonmunro on GitHub.
Currently the module system lets you override modules from other sets, but if those modules call functions, you end up having to duplicate a lot of code (potentially) just to change a function call.
I propose ALL functions defined in modules be wrapped in a "if not function exists" conditional. Currently, if the site module set is present, its "lib.php" file will be included before any module set specific code. This would allow sites to override a function defined in any module set using the site modules.
For example, if I wanted to change the date format for all messages lists regardless of source, using the module system as it works now would take a TON of work and a lot of duplicate code. If we make the above change, a site could simply override the human_readable_interval function to implement the change.
@jasonmunro commented on GitHub (Dec 21, 2017):
This is now complete. Along with these changes I fixed the inclusions of the site/lib.php file to occur only if the site module set is enabled.