[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] Some issues related to updating items with comments
"Victor Emanouilov \(@kroky\) via TikiWiki-cvs" <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <69b2caf83fc5f_3b18a21865572@gitlab-sidekiq-low-urgency-cpu-bound-v2-59559c85bb-jqlss.mail> |
Victor Emanouilov pushed to branch master at Tiki Wiki CMS Groupware / Tiki
Commits:
ec7485e5 by Merci Jacob at 2026-03-12T14:03:37+00:00
[FIX] Some issues related to updating items with comments
---
* [FIX] comment title missing when upating item with comment
* [FIX] validation failure for 'comment-title' field when updating items due maxlength remaining unset
* [FIX] incorrect template path included in 'comment/post.tpl'
* [FIX] Comment textarea, when updating tracker item, inherits $data from available 'textarea' field
See merge request tikiwiki/tiki!9730
- - - - -
3 changed files:
- lib/core/Services/Tracker/Controller.php
- templates/comment/post.tpl
- templates/tracker/update_item.tpl
Changes:
=====================================
lib/core/Services/Tracker/Controller.php
=====================================
@@ -1246,6 +1246,8 @@ class Services_Tracker_Controller
throw new Services_Exception_Denied();
}
+ $version = TikiLib::lib('trk')->last_log_version($itemId) + 1;
+
$access = TikiLib::lib('access');
if ($prefs['feature_warn_on_edit'] == 'y' && $input->conflictoverride->int() !== 1) {
try {
@@ -1407,16 +1409,13 @@ class Services_Tracker_Controller
if ($input->addComment->bool()) {
$comment = new Services_Comment_Controller();
-
- $version = TikiLib::lib('trk')->last_log_version($itemId);
-
$comment->action_post(new JitFilter([
'post' => 1,
'anonymous_name' => $input->comment_anonymous_name->text(),
'comment' => $input->comment->text(),
'objectId' => $itemId,
'type' => 'trackeritem',
- 'title' => tr('Comment for edit #%0', $version),
+ 'title' => $input->title->text(),
'data' => $input->data->wikicontent(),
'return_url' => $input->redirect->none(),
'version' => $version,
@@ -1530,7 +1529,9 @@ class Services_Tracker_Controller
'save_return' => $input->save_return->alpha() ?? 'n',
'can_remove' => $itemObject->canRemove(),
'skipRefresh' => $input->skipRefresh->bool(),
+ 'commentTitle' => tr('Comment for edit #%0', $version),
'MAX_COMMENT_DATA_LENGTH' => TikiLib::lib('comments')::MAX_COMMENT_DATA_LENGTH,
+ 'MAX_COMMENT_TITLE_LENGTH' => TikiLib::lib('comments')::MAX_COMMENT_TITLE_LENGTH,
];
}
=====================================
templates/comment/post.tpl
=====================================
@@ -17,7 +17,7 @@
{else}
<form method="post" action="{service controller=comment action=post}">
<div class="card">
- {include file="post_form_content.tpl"}
+ {include file="comment/post_form_content.tpl"}
<div class="card-footer">
{if $prefs.feature_antibot eq 'y'}
{$showmandatory='y'}
=====================================
templates/tracker/update_item.tpl
=====================================
@@ -53,7 +53,7 @@
</label>
</div>
<div class="comment-form d-none">
- {include file="comment/post_form_content.tpl" type='trackeritem' objectId=$itemId}
+ {include file="comment/post_form_content.tpl" type='trackeritem' objectId=$itemId data='' title=$commentTitle}
</div>
{/if}
<div class="submit">
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/ec7485e542bd46d13ccb1a77145d368fd9fa130f
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/ec7485e542bd46d13ccb1a77145d368fd9fa130f
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help
_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs