Skip to content

[5.4] Show readmore in mod_articles when introtext_limit truncates text#47966

Open
rish106-hub wants to merge 1 commit into
joomla:5.4-devfrom
rish106-hub:fix/47710-mod-articles-readmore-introtext-limit
Open

[5.4] Show readmore in mod_articles when introtext_limit truncates text#47966
rish106-hub wants to merge 1 commit into
joomla:5.4-devfrom
rish106-hub:fix/47710-mod-articles-readmore-introtext-limit

Conversation

@rish106-hub

Copy link
Copy Markdown

Pull Request resolves #47710.

  • I read the Generative AI policy and my contribution is either not created with the help of AI or is compatible with the policy and GNU/GPL 2 or later.

Summary of Changes

PR #47263 fixed readmore showing when there is nothing to read, but introduced a regression: when introtext_limit is used to truncate text (instead of a readmore marker), $item->fulltext is empty so the readmore button never renders even though the article IS truncated and there IS more to read.

Fix tracks whether truncation actually occurred and uses that flag alongside $item->fulltext to decide readmore visibility.

Testing Instructions

  1. Create an article with only introtext (no readmore marker), body > 100 chars
  2. Create a mod_articles module: set Introtext Limit = 50, Show Read More = Yes
  3. View frontend — readmore button should appear
  4. Shorten article text below limit — readmore button should disappear
  5. Article with readmore marker — unaffected, still shows readmore

Actual result BEFORE applying this PR

No readmore button shown even though text is truncated by introtext_limit

Expected result AFTER applying this PR

Readmore button appears when introtext is truncated. Does not appear when text fits within limit. Articles using readmore marker unaffected.

  • No documentation changes for guide.joomla.org needed
  • No documentation changes for manual.joomla.org needed

@richard67

Copy link
Copy Markdown
Member

There is already a PR for the same issue: #47713 .

@rish106-hub

Copy link
Copy Markdown
Author

@richard67 Thanks for flagging #47713.

Our approach differs in a key way: #47713 has an open review comment from @QuyTon noting the fix executes even when show_introtext is disabled.

In this PR, $item->introTextTruncated is initialized to false in the helper and only set to true inside the if ($show_introtext) block — so the template condition is always safe when intro text display is off. This addresses QuyTon's concern.

Happy to close if maintainers prefer to update #47713 instead.

@krishnagandhicode

Copy link
Copy Markdown
Contributor

I have tested this item ✅ successfully on 5621400

Thanks.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47966.

@rish106-hub

rish106-hub commented Jun 16, 2026

Copy link
Copy Markdown
Author

@richard67 — adding to my earlier response:

@krishnagandhicode has independently tested and confirmed this PR works correctly on 5621400.

To summarise why this PR addresses the regression more completely than #47713:

With a passing test and CI green, happy to have this reviewed for merge or to close in favour of a corrected #47713 - whichever the team prefers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[5.4] No readmore button in Articles Module when text limit is in use

4 participants