[PHPBB3-16426] Search settings should allow specification of number of characters to return

Discuss requests for comments/changes posted in the Issue Tracker for the development of phpBB. Current releases are 3.2/Rhea and 3.3/Proteus.
User avatar
EA117
Registered User
Posts: 21
Joined: Tue Apr 30, 2019 12:54 pm

Re: [PHPBB3-16426] Search settings should allow specification of number of characters to return

Post by EA117 »

mrgoldy wrote: Sat Apr 11, 2020 8:13 pm Perhaps you guys want to test them out aswell ;)
Sorry, had not made it back in for a while. Indeed, appreciate the quick work. Very clean and elegant on the "forum search" link, and appropriate that a style could continue using U_SEARCH if desired or opt-in to the new U_SEARCH_FORUM link like prosilver did.

On adding the returned characters as an ACP default, in addition to turning it into numeric input instead of a select control, everything looks technically correct there to me, too. One suggestion or request -- given that presumably this change will appear in "a point release" like 3.3.1 or similar -- would be to include "forgiveness" for existing phpBB 3.3.0-compatible styles, by continuing to build the S_CHARACTER_OPTIONS string containing the select control. (With appropriate comment added about how it's deprecated and should be removed in phpBB 4.0 or similar.)

I'm just thinking with the way the HTML forms work, we can continue supporting existing phpBB 3.3.0 styles "for free", because the form POST doesn't care whether value 300 came from a <select> control or from an <input> control. The name of the field ("ch") and it's value is all that matters. As such, it seems very easy and cheap to simply let phpBB 3.3.0 styles continue working successfully whether they've been updated to remove usage of S_CHARACTER_OPTIONS yet or not. The "all characters" value built in the select control to be zero now instead of -1, of course.

Your call obviously. And welcome any correction on the technical point that prevents this from actually being as easy as I'm proposing here.

User avatar
mrgoldy
Former Team Member
Posts: 64
Joined: Fri Dec 18, 2015 9:41 pm
Location: The Netherlands
Contact:

Re: [PHPBB3-16426] Search settings should allow specification of number of characters to return

Post by mrgoldy »

You make a valid point. I've added a BC layer for it, still generating the select options and adding the admin defined setting if need be.
phpBB Studio Proud member of the Studio!

User avatar
EA117
Registered User
Posts: 21
Joined: Tue Apr 30, 2019 12:54 pm

Re: [PHPBB3-16426] Search settings should allow specification of number of characters to return

Post by EA117 »

That's awesome, thanks. Clearly there are some changes where "you'll need to update the style" is the only practical option; this one just felt like there was an "easy" backwards compatibility story.

Post Reply