[3.3][BETA] Major 2025 overhaul of RH Topic Tags extension for phpBB 3.3.x

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Get Involved
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
User avatar
SMcCandlish
Registered User
Posts: 92
Joined: Wed Oct 27, 2021 2:14 am

[3.3][BETA] Major 2025 overhaul of RH Topic Tags extension for phpBB 3.3.x

Post by SMcCandlish »

Extension Name: RH Topic Tags [SMcCandlish fork]
Author: SMcCandlish, based on original 2016–2020 code by Robert Heim (combuster)

Extension Description: Update of extension for content-tagging of topics, to work properly in phpBB 3.3.x, to fix security issues and other bugs, and to add some features.
Extension Version: 3.0.2-beta2

Requirements: phpBB 3.3.0+ (thus PHP 7.2.0+).

Features:
Overhaul:
  • Combines an array of compatibility patching attempts by various phpBB.com and Github.com contributors to bring the original into compatibility with various sub-versions of phpBB 3.3.x.
  • Known-working in phpBB 3.3.5; needs testing in >3.3.5, especially >3.3.12.
  • Adds some all-new improvements on top of those patches.
  • Extensive overhaul.
  • Multiple types of security fixes.
  • More ACP sorting options.
  • Human-friendly alphanumeric sorting of tags.
  • Fixed tag rename/merge/delete bugs.
  • Finer-grained tag sizing in tag-cloud display.
  • Much code and documentation cleanup.
  • Dark theme support.
  • Tags are essentially case-insensitive by default (if you create a tag "foo", then "Foo" or "FOO" or "fOO" will be the same tag – no more tedious need for frequent admin merging of accidental duplicates).
  • READ THE README. It is important to disable original extension (if in use), remove its files, install new version, enable, and purge cache!
Original features preserved (some improved):
  • Add tags when posting a new topic.
  • Tag suggestions based on existing tags.
  • Edit tags when editing first post of topic.
  • SEO optimization: tags are added to meta-content keywords in viewtopic.
  • Tags are shown in viewforum (can be disabled in ACP).
  • Enable tagging of topics on a per-forum basis.
  • Responsive layout.
  • Full UTF-8 support.
  • Search topics by tag(s), using URL strings:
    • /tag/tag1,tag2 – 1 or more tags, AND search (default)
    • /tag/tag1,tag2/OR – 2 or more tags, OR search
    • /tag/tag1,tAG2/AND/true - 2 or more tags, AND search, case-sensitive (will not match "Tag1" or "tag2")
  • /tags (plural) shows a tag cloud/
  • ACP option for tag cloud also to be displayed on the board index page.
  • Dynamic tag-size in tag cloud depending on its usage count.
  • ACP option to also enable/disable display of tags' numeric usage counts in tag cloud.
  • Configure a regex to decide which characters in tags are valid and which are not.
  • Maintenance functions in ACP > Extensions > RH Topic Tags.
  • Tag blacklist and whitelist
  • User and mod+admin permissions for who can add/edit tags.
  • Spaces in tags are converted to "-" by default (you can disable that in ACP).
  • Manage existing tags in ACP: rename, delete, merge (rename one tag to the same name as another and they will automatically be merged).
  • Enable tags in specific forums or site-wide.
Screenshots:
Screenshot 2025-03-21 171837.png
Screenshot 2025-03-21 172601.png
Extension Download: https://github.com/SMcCandlish/phpBB-ex ... s/releases
You do not have the required permissions to view the files attached to this post.
User avatar
SMcCandlish
Registered User
Posts: 92
Joined: Wed Oct 27, 2021 2:14 am

Re: [3.3][BETA] Major 2025 overhaul of RH Topic Tags extension for phpBB 3.3.x

Post by SMcCandlish »

So far, there's a "not working" initial feedback from someone using phpBB 3.3.14, but without any details yet as to what errors might have been reported in logs, so it's unclear what the nature of the issue might be.
User avatar
nou nou
Registered User
Posts: 790
Joined: Sat Oct 29, 2016 8:08 pm

Re: [3.3][BETA] Major 2025 overhaul of RH Topic Tags extension for phpBB 3.3.x

Post by nou nou »

Oh nice! Good to see this - I have used topic tags before but I ran into some issues that you seem to be fixing, like the case sensitivity was really doing my nut in.

I'd happily test this for you as soon as I can, my test board is 3.3.14 on php8.1+
User avatar
eunaumtenhoid
Registered User
Posts: 1199
Joined: Wed Jun 03, 2009 12:46 am
Location: ????

Re: [3.3][BETA] Major 2025 overhaul of RH Topic Tags extension for phpBB 3.3.x

Post by eunaumtenhoid »

nice work dude , congratulations!
My translations of the extensions for Brazilian Portuguese
https://github.com/phpBBTraducoes
User avatar
nou nou
Registered User
Posts: 790
Joined: Sat Oct 29, 2016 8:08 pm

Re: [3.3][BETA] Major 2025 overhaul of RH Topic Tags extension for phpBB 3.3.x

Post by nou nou »

Ah, question - should we delete data if an older version of topictags was installed and start over, or should everything migrate?

Either is fine for me.
User avatar
SMcCandlish
Registered User
Posts: 92
Joined: Wed Oct 27, 2021 2:14 am

Re: [3.3][BETA] Major 2025 overhaul of RH Topic Tags extension for phpBB 3.3.x

Post by SMcCandlish »

nou nou wrote: Sat Mar 22, 2025 3:32 pm Ah, question - should we delete data if an older version of topictags was installed and start over, or should everything migrate?
No need to delete data, just the files. Various files had to move because of changes to phpBB's security model. So, you disable it, move the original to somewhere like your home directory, then install the new one, enable it, purge board cache, and check your "allowed characters" regex for issues covered in the documentation.
User avatar
SMcCandlish
Registered User
Posts: 92
Joined: Wed Oct 27, 2021 2:14 am

Re: [3.3][BETA] Major 2025 overhaul of RH Topic Tags extension for phpBB 3.3.x

Post by SMcCandlish »

nou nou wrote: Sat Mar 22, 2025 2:51 pm I'd happily test this for you as soon as I can, my test board is 3.3.14 on php8.1+
That is the version about which a "not working" report already came in, but without sufficient info for me to act on. If you also get that result, I'll need error messages, error log entries, etc., to have some idea what the failure point might be.

When I get a chance, I will try setting up a 3.3.14 dev board for more direct testing. My "real" board is stuck at 3.3.5 for a while because it's using dozens of extensions and a number of them need patching to work with later versions. RH Topic Tags has simply been the first of many to take on.

Edit: There are some details now, but they're strange. The thread about this is here:
https://www.phpbb.com/customise/db/exte ... 78#p895078
User avatar
nou nou
Registered User
Posts: 790
Joined: Sat Oct 29, 2016 8:08 pm

Re: [3.3][BETA] Major 2025 overhaul of RH Topic Tags extension for phpBB 3.3.x

Post by nou nou »

Yeah, I get an HTTP 500 server error when trying to enable the extension.

Weirdly, there is nothing in the error log :shock:

only this in the access log:

Code: Select all

[22/Mar/2025:14:04:38 -0700] "POST /testforum/adm/index.php?i=acp_extensions&sid=d7631d9f23cfa0f58c76ca8ba2f7d468&mode=main&action=enable&ext_name=robertheim%2Ftopictags&hash=8fde6c14 HTTP/2.0" 500 50 "https://www.testforum.dev/testforum/adm/index.php?i=acp_extensions&sid=d7631d9f23cfa0f58c76ca8ba2f7d468&mode=main&action=enable_pre&ext_name=robertheim%2Ftopictags" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36" 
[22/Mar/2025:14:04:39 -0700] "GET /testforum/sw.js HTTP/2.0" 200 417 "https://www.testforum.dev/testforum/sw.js" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36" 
User avatar
SMcCandlish
Registered User
Posts: 92
Joined: Wed Oct 27, 2021 2:14 am

Re: [3.3][BETA] Major 2025 overhaul of RH Topic Tags extension for phpBB 3.3.x

Post by SMcCandlish »

nou nou wrote: Sat Mar 22, 2025 9:09 pmYeah, I get an HTTP 500 server error when trying to enable the extension.
In which phpBB version?
Weirdly, there is nothing in the error log :shock:
500 errors often produce a message with details.

And sometimes such errors get logged in a higher level of logging. E.g., on my system, I have /var/log/apache2/error.log and /var/log/apache2/domains/dev.example.com.error.log. And there is also /var/log/php7.4-fpm.log and /var/log/nginx/error.log (plus /var/log/nginx/domains/*.log files, but none of those pertain to my phpBB webserver, only the webmail one).
User avatar
SMcCandlish
Registered User
Posts: 92
Joined: Wed Oct 27, 2021 2:14 am

Re: [3.3][BETA] Major 2025 overhaul of RH Topic Tags extension for phpBB 3.3.x

Post by SMcCandlish »

Okay, so I just forcibly upgraded my dev server to phpBB 3.3.14, despite this being almost certain (with me going from 3.3.5 with 30+ extensions installed) to break various things because of extensions that are going to need to be updated to work with late 3.3.x versions of the board 'ware.

However, RH Topic Tags 3.0.2 (the beta from yesterday) is working just fine in it. I tested most of its functionality, and there were no issues.

But I already had it installed in the phpBB 3.3.5 setup of the dev server.

Perhaps there is some issue with doing either:
- a totally new install in phpBB 3.3.14 without RH Topic Tags having been used before on this system at all; or
- a re-installation in phpBB 3.3.14 some time after RH Topic Tags had been previously used before (perhaps RH TT 0.0.7 or whatever in phpBB 3.3.2 or whatever) with some element of the old code or its output lingering in some way that is not compatible with the current version.

I'm not sure how to test these hypotheses beyond deleting all RH Topic Tags data from my dev board (purging the data as well as the files when uninstalling) and doing a clean-slate install of RH Topic Tags 3.0.2 to see if if works as expected; and then purging it all again and installing an old 2020-ish version of RH Topic Tags, making some tags with it to the extent that version of the extension can be made to work in phpBB 3.3.14 at all, then disabling and removing its files (but leaving its data), and install RH TT 3.0.2 without nuking the data and see what happens in that circumstance.

My initial suspicion is that if one were previously using or attempting to use RH TT from a very old version, perhaps even dating back to phpBB 3.2.x or older, in a board that had subsequently been upgraded to phpBB 3.3.x, then the "ancient" RH TT stuff might just have to be removed from the DB. If that's the case, then a worst-case scenario is that one might have to get Robert Heim's old RH TT (from his GitHub or from phpBB's extensions server), install and enable it (perhaps patching it in some ways to get it to load in current phpBB at all), then disable it and tell phpBB to delete its data, then remove RH TT's files, then install the new RH TT and start with fresh tagging, an entirely clean slate. That would not be ideal for anyone who had done much tagging earlier.

One thing I can say is that RH TT changed a bunch of times, in ways that involved migrations files, during the 2016–2020 span. My overhaul is based on the last of the 2020 codebase upgrades, plus patches other people worked out, then my own feature improvements later. All of this was built incrementally in situ on top of a patched 2020 version, not by uninstalling RH TT entirely and clearing its data out and reinstalling it after tweaks were made to it. So, if there's a database-level incompatibility it is probably being inherited from pre-2020 RH TT structures that my overhaul hasn't touched, because it's expecting either a clean install or an upgrade from the 2020 version.

Another possibility is that phpBB, due to its "aggressive" cacheing, is retaining cached class definitions and other stuff pertaining to an old version, even when development mode is turned on. I have found in testing that I have to make frequent use of "ACP > General > Purge the cache", even when doing things as simple as changing a line of CSS code.
User avatar
eunaumtenhoid
Registered User
Posts: 1199
Joined: Wed Jun 03, 2009 12:46 am
Location: ????

Re: [3.3][BETA] Major 2025 overhaul of RH Topic Tags extension for phpBB 3.3.x

Post by eunaumtenhoid »

request:
  • could you add tags in the search
  • add compatibility with similar topics
My translations of the extensions for Brazilian Portuguese
https://github.com/phpBBTraducoes
User avatar
SMcCandlish
Registered User
Posts: 92
Joined: Wed Oct 27, 2021 2:14 am

Re: [3.3][BETA] Major 2025 overhaul of RH Topic Tags extension for phpBB 3.3.x

Post by SMcCandlish »

eunaumtenhoid wrote: Sun Mar 23, 2025 1:29 am request:
  • could you add tags in the search
  • add compatibility with similar topics
I'm not quite sure what either of these requests is asking for, especially the second.

The tags are already searchable via their own clearly documented search system. It might be feasible to make tags' text content indexed along with post body and heading (subject) content for the site's built-in search system. The Topic Descriptions extension has an side extension (available non-free from a third-party developer, as I recall, not from phpBB's extensions database) that makes descriptions' content searchable in this way, so whatever it is doing could probably be adapted to tags also.

But I don't know what you mean by "similar topics". Topics similar to what, in what way?

Edit: If you mean the Precise Similar Topics extension https://www.phpbb.com/customise/db/exte ... ar_topics/ then that is something I could look into, later. For now it's most important to work out any problems that prevent people from running RH Topic Tags on their board at all, then add some already-planned new features that don't require additional extensions.

In the case of PST, it looks like it is taking the heading/subject string and breaking it up into substrings, discarding junk words like "the", then searching for other threads whose titles include any of the more interesting substrings. That sounds like something that could be adapted to handle tags as well, with some effort. However, PST also seems to be doing its own custom database routines (because it says it is only compatible with less than half the DB backends supported by phpBB), and that's problematic. It would probably be the best approach to rewrite it using phpBB-native code for database queries, and that could take significant work. I would also have to figure out how to get one extension to modify the behavior of another, which is non-trivial because of the namespace delimitations in phpBB's object-oriented PHP approach. Extensions are a bit "sandboxed".
Last edited by SMcCandlish on Sun Mar 23, 2025 3:36 am, edited 1 time in total.
User avatar
eunaumtenhoid
Registered User
Posts: 1199
Joined: Wed Jun 03, 2009 12:46 am
Location: ????

Re: [3.3][BETA] Major 2025 overhaul of RH Topic Tags extension for phpBB 3.3.x

Post by eunaumtenhoid »

SMcCandlish wrote: Sun Mar 23, 2025 2:29 am
eunaumtenhoid wrote: Sun Mar 23, 2025 1:29 am request:
  • could you add tags in the search
  • add compatibility with similar topics
I'm not quite sure what either of these requests is asking for, especially the second.

The tags are already searchable via their own clearly documented search system. It might be feasible to make tags' text content indexed along with post body and heading (subject) content for the site's built-in search system. The Topic Descriptions extension has an side extension (available non-free from a third-party developer, as I recall, not from phpBB's extensions database) that makes descriptions' content searchable in this way, so whatever it is doing could probably be adapted to tags also.

But I don't know what you mean by "similar topics". Topics similar to what, in what way?
my bad.
search, It would be the phpbb search page, currently the tags do not appear on that page
similar topics, would be to add compatibility with this extension (https://www.phpbb.com/customise/db/exte ... ar_topics/), making the tags appear in similar topics

Furthermore, it would be nice to have a topiclist event on the TAGS page, to show other extensions on the tags page as well, such as the phpbb topic prefixes extension.
My translations of the extensions for Brazilian Portuguese
https://github.com/phpBBTraducoes
rxu
Extensions Development Team
Posts: 4105
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation

Re: [3.3][BETA] Major 2025 overhaul of RH Topic Tags extension for phpBB 3.3.x

Post by rxu »

phpBB 3.3.14, PHP 8.4.1. Got the following fatal error on the extension (v.3.0.2 beta) enabling step:

Code: Select all

Fatal error: Uncaught TypeError: robertheim\topictags\service\tags_manager::__construct(): Argument #5 ($language) must be of type phpbb\language\language, robertheim\topictags\service\db_helper given, called in [ROOT]\ext\robertheim\topictags\migrations\release_0_0_8.php on line 78 and defined in [ROOT]\ext\robertheim\topictags\service\tags_manager.php on line 50

User avatar
SMcCandlish
Registered User
Posts: 92
Joined: Wed Oct 27, 2021 2:14 am

Re: [3.3][BETA] Major 2025 overhaul of RH Topic Tags extension for phpBB 3.3.x

Post by SMcCandlish »

rxu wrote: Sun Mar 23, 2025 5:13 am phpBB 3.3.14, PHP 8.4.1. Got the following fatal error on the extension (v.3.0.2 beta) enabling step:

Code: Select all

Fatal error: Uncaught TypeError: robertheim\topictags\service\tags_manager::__construct(): Argument #5 ($language) must be of type phpbb\language\language, robertheim\topictags\service\db_helper given, called in [ROOT]\ext\robertheim\topictags\migrations\release_0_0_8.php on line 78 and defined in [ROOT]\ext\robertheim\topictags\service\tags_manager.php on line 50
As noted above, I think this must be an indication that you once had a very, very old version of this installed (0.0.7 or earlier), which is from an era in which various database changes were made to the original version of this extension (and not necessarily properly accounted for in release_0_0_8.php). I can't think of any other reason for phpBB to even look at migrations/release_0_0_8.php at all, ever, unless it is convinced is is upgrading from 0.0.7. I can't replicate this problem, since my board is not many years old, has not been successively upgraded over a bunch of versions, and never had the original-era RH Topic Tags.

It is has only had RH TT 3.0.0, and I built this 3.0.1 then 3.0.2 overhaul directly on top of 3.0.0, building it incrementally. I just installed phpBB 3.3.14 on my dev server, and RH TT 3.0.2 worked perfectly.

I think the only solution to your issue may be temporarily re-installing a way-old version of RH TT (the one available from the phpBB Extension Database or Robert Heim's GitHub), then disabling it, then telling phpBB to delete its data from the database, then removing its files, then installing RH TT 3.0.2 and enabling it, flushing cache, and starting with a completely clean tagging slate. For me to pore over RH's entire decade-long codebase looking for which seemingly innocuous change caused a db-level incompatibility could take all year.

Return to “Extensions in Development”