Custom Thread Field error

beerForo

Well-known member
Affected version
2.3
I am requiring a URL in a rich text box for YT embeds, and in testing, I can just enter a word and it saves (not a URL). It should prompt for a valid URL format.
1732320879142.webp
Side note: When choosing "Thread status block" as the location, there is a third party cookie button you must choose to see the embed (youtube), but, that does not happen with the two other location settings.
 
Last edited:
"Value Match" means it should not post unless it is a URL correct? And they should receive a prompt telling them so, correct? I've been waiting to use this field until this can be addressed, so just making sure. Thanks
 
So, if I understand correctly, you'd want to use a single-line text box for this. I don't think that the matching format rule would apply to a Rich Text box. In testing, I get the expected result using the single-line text box whereas the Rich Text box doesn't use the matching rules, from what I can tell. I'm not sure that I would expect it to... possibly, this option section needs better comments added to explain when the matching rules apply and when they don't.

Tested with xf 2.3.6
 
This would be for an embedded video and currently it's not working as intended as it states that URL can be a value match for a rich text box. Embedding does work of course, just not the URL validation, which causes issues of members adding text or posting text only.
 
Oh, I see what you are saying. You're trying to embed something extra on top of the post content through the custom field (of rich text).
No, the single-line text box doesn't embed the posted URL. :(

What's the difference in embedding in the normal thread/post view? vs the rich text box you are trying to create?
 
"Value Match" means it should not post unless it is a URL correct? And they should receive a prompt telling them so, correct? I've been waiting to use this field until this can be addressed, so just making sure. Thanks
The point of a rich text box is that you can do all kinds of formatting with it, some of that formatting would break a URL. So the real solution to this problem is not to allow you to check that URL setting for a rich text box.

If that setting worked on a rich text box, then the only thing you could post in it would be a URL, or multiple URLs. No code, no generic text, no fonts or color changes.
 
Agreed and it should embed, so perform the check before it appends the bbcode, otherwise, the value match option should be removed.

Well yes which includes embedding a video.
Well there is a difference between embedding and linking. A URL is designed only to link. The embedding/unfurling is a feature built into forum posts, but it is not built into every place there is a rich text box. That is not a native function of hyperlinks which is why there is a separate box inside the rich text box just for that.

You are trying to mash two separate functions together and then limit one of those functions. You are trying to tell the rich text box not to act like a rich text box, the only function you want from it is the embedding. You probably have to do this as a PHP callback and then call the embed function from there.
 
The XenForo software is telling me this is possible so perhaps you should take it up with them.
I already acknowledged that they should remove that option from the list. See post #7. They probably did not consider that someone would try to force a rich text box to not be a rich text box and instead limit it to links only. I would not have considered that either because to me that is the old square peg in a round hole argument.

All I am trying to do is tell you that you are asking it to do something it was not designed to do and gave you an alternative to look up the PHP call. What you do with that is on you.
 
The embedding/unfurling is a feature built into forum posts, but it is not built into every place there is a rich text box.
The field does embed. That's not the issue. I'll await XF's reply to the issue.

Use case: Field description states to enter a YT URL. User does and when posting it embeds. Issue is URL Value Match does not work and allows them to add text that should not be tere. Thanks!
 
Last edited:
Back
Top Bottom