*

morfik

  • ****
  • 169 posts
Limit in the ad title isn't respected
« on: February 08, 2023, 11:41:23 AM »
There's an option under Listing > Settings which is responsible for the length of the ad title. It's default value is 100. When this limit is set to the default value, everything is fine, i.e. when you try to post an ad with 100+ chars, the error will be printed, and the ad won't be published.

The problem is when you raise the limit to more than 100 chars, for instance 150. In this case, when you try to post an ad with 150+ chars, you also get the error. But when you try to post an ad with more than 100 and less than 150 chars, everything after 100 char will be silently deleted, and the ad will be published without any error, warning, or info.

Marked as best answer by frosticek on February 13, 2023, 10:15:35 AM
*

MB Themes

Re: Limit in the ad title isn't respected
« Reply #1 on: February 08, 2023, 07:40:57 PM »
Problem is most probably that setting does not change database field and that is probably correct.
You can do it in database, t_item_descriotion table, increase length of s_title column.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

morfik

  • ****
  • 169 posts
Re: Limit in the ad title isn't respected
« Reply #2 on: February 10, 2023, 09:26:44 PM »
So what's the purpose of the field, if a user needs to manually edit the database?

*

MB Themes

Re: Limit in the ad title isn't respected
« Reply #3 on: February 13, 2023, 10:15:31 AM »
Original purpose was to only limit max length.
It's not good idea to let osclass update database column length, as if you reduce it, it automatically trim longer titles and they will get lost.
Will think about ideal solution in future version.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

morfik

  • ****
  • 169 posts
Re: Limit in the ad title isn't respected
« Reply #4 on: February 15, 2023, 09:15:57 AM »
Original purpose was to only limit max length.
It's not good idea to let osclass update database column length, as if you reduce it, it automatically trim longer titles and they will get lost.
Will think about ideal solution in future version.

I would hardcode some more chars, for instance 150, set the default to 100, inform user that there's max 150 and return error if set more that 150.  :)

*

MB Themes

Re: Limit in the ad title isn't respected
« Reply #5 on: February 15, 2023, 10:34:31 AM »
@morfik
What if there is another person that ask about limit 200?
Then another with limit 500 etc?

That's not solution. Will keep it as it is for now until will have better solution ;)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

morfik

  • ****
  • 169 posts
Re: Limit in the ad title isn't respected
« Reply #6 on: February 15, 2023, 11:04:42 AM »
@morfik
What if there is another person that ask about limit 200?
Then another with limit 500 etc?

That's not solution. Will keep it as it is for now until will have better solution ;)

The hardcoded value could be bigger, it was just an example. You could set 500 or 1000 -- any big number will do the job here. The idea is to set some big number, so there was no need to manually edit the database.

*

MB Themes

Re: Limit in the ad title isn't respected
« Reply #7 on: February 15, 2023, 11:39:43 AM »
It negatively impact size of table, index and search capabilities.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

morfik

  • ****
  • 169 posts
Re: Limit in the ad title isn't respected
« Reply #8 on: February 15, 2023, 12:05:18 PM »
In my opinion, it should be a reasonable limit set, like 150/200. Set the default to 100, and prevent setting more than the limit with an error presented to the user.