Skip to content

fix(ticket): auto_introtext + ticket_max_cut (#218) - #219

Draft
Ibochkarev wants to merge 1 commit into
masterfrom
fix/issue-218-auto-introtext-max-cut
Draft

Ibochkarev wants to merge 1 commit into
masterfrom
fix/issue-218-auto-introtext-max-cut

Conversation

@Ibochkarev

Copy link
Copy Markdown
Member

Summary

  • With tickets.auto_introtext enabled, web create/update past tickets.ticket_max_cut without <cut/> inserts the cut at that length instead of returning ticket_err_cut, so introtext can fill from the teaser.
  • getIntroText() caps teasers to ticket_max_cut (and recovers from an empty teaser when cut is at the start).
  • Cut/introtext logic lives on Ticket (prepareWebContent, resolveIntrotext, ensureAutoIntrotext); create/update processors and save() call it once.

Closes #218

Test plan

  • tickets.auto_introtext=Да, tickets.ticket_max_cut=500: create ticket on web with >500 chars, no <cut/> → save OK, introtext ≈ first 500 chars, content contains <cut/>
  • Same with auto_introtext=Нет → still ticket_err_cut
  • Content with explicit <cut/> → introtext = text before cut (unchanged)
  • Cut at start of content → introtext falls back to capped body after cut
  • Mgr save of long content without cut → introtext capped, content unchanged
  • Empty introtext + auto on → filled; auto off → stays empty

With auto_introtext on, web saves no longer die on missing <cut/> past
ticket_max_cut: insert the tag at that length and build introtext from the
teaser. Centralize cut/introtext helpers on Ticket; processors and save() reuse them.

Closes #218
@Ibochkarev
Ibochkarev force-pushed the fix/issue-218-auto-introtext-max-cut branch from 86d9f12 to 830400e Compare September 9, 2026 15:49
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.

bug: auto_introtext не заполняется при ограничении в 500 символов

1 participant