Skip to content

Fix/multi tasklist usage#19

Closed
TDannhauer wants to merge 2 commits into
FRAMEWORK_6_0from
fix/multi_tasklist_usage
Closed

Fix/multi tasklist usage#19
TDannhauer wants to merge 2 commits into
FRAMEWORK_6_0from
fix/multi_tasklist_usage

Conversation

@TDannhauer

Copy link
Copy Markdown
Contributor

Cause

When you have more than one task list, the Task List field uses a “reload” action (Horde_Form_Action_reload). Changing the list submits the form to /nag/t/save (SaveTaskController).

If validation fails (normal on reload), the controller falls back to legacy task.php to redraw the form. That script expects $registry in the global scope (line 156: $registry->get('jsfs', 'horde')).

On the Rampage/PSR route, the registry is available on the controller ($this->registry) but was not copied into $GLOBALS['registry'] before including task.php, so you got “Undefined variable $registry”.

There was also a bad global $form line that pointed at an unset global instead of the form object built in the controller.

Fix
SaveTaskController.php — Before require task.php, set $GLOBALS['registry'] = $this->registry and remove the incorrect global $form.
task.php — If $registry is still missing after global, resolve it from $GLOBALS['registry'] or the injector.
Try again: open New Task, change the task list in the combo box. The form should reload without crashing.

Note: These edits are under vendor/horde/nag/. A composer update may overwrite them; consider reporting upstream to Horde or keeping a local patch. I can help with a Composer patch or overlay if you want that next.

Added legacy support for task.php by setting Horde globals.
Initialize registry if not set and make it global.
@TDannhauer TDannhauer requested a review from ralflang May 21, 2026 18:03
@TDannhauer

Copy link
Copy Markdown
Contributor Author

please review, I know we are fighting to get rid of globals

@ralflang

Copy link
Copy Markdown
Member

Don't set globals in controller - pass the variable as parameter. Globals is something we want to reduce, not embrace.

@ralflang

Copy link
Copy Markdown
Member

@TDannhauer
#20 also covers this as part of a more severe refactoring to a cleaner architecture. Please test. If you find severe bugs in #20, merge #19 for the time being and let us take our time to improve #20 as the more complete solution.

TDannhauer added a commit that referenced this pull request May 22, 2026
refactor: Use controllers rather than globals. Addresses #19
@TDannhauer TDannhauer closed this May 22, 2026
@TDannhauer TDannhauer deleted the fix/multi_tasklist_usage branch May 22, 2026 08:27
ralflang added a commit that referenced this pull request May 28, 2026
Release version 5.0.0-RC3

Refactor tasklist cache and sync list handling
Refactor task retrieval logic in Sql.php
fix(security): restrict unserialize allowed_classes (ZDI-20-1051)
refactor: Transition to unified screen.css
Remove persistPrefs() calls from tasklist methods
Refactor ActiveSync task list cache handling
Update Nag.php
Refactor tasklist creation to include sync options
Enhance addTasklist with synchronization and persistence
Enhance tasklist management with sync functionality
Refactor ActiveSync error handling and notifications
Sync tasklist after adding it
Refactor synchronization of tasklist addition
Refactor sync_lists handling in task management
chore: Update workflow dependency
Merge pull request #23 from horde/refactor/adopt-format-parse
refactor(nag): delegate parseDate() to Format::parse()
Update addTasklist method documentation
Merge pull request #22 from horde/fix/array_offset_access
Merge pull request #21 from horde/fix/date_format
Enhance validation checks in NagMethod
Refactor getInfo and isValid methods for NagAlarm
Add ICU date formatting support in parseDate method
Merge pull request #20 from horde/refactor/multi_tasklist_usage_2
refactor: Use controllers rather than globals. Addresses #19
refactor: Replace strftime with IntlDateFormatter
refactor(injector): Widen type hints from Horde_Injector to Horde_Injector|Injector
style: constrain tag list icon size to 16px
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants