Previous Thread
Next Thread
Print Thread
Hop To
Joined: Apr 2019
Posts: 44
Newbie
Newbie
Joined: Apr 2019
Posts: 44
Line#: 161
SQL Error: Incorrect integer value: '' for column 'SUBSCRIPTION_END_DATE' at row 1
SQL Error #: 1366
Query: update ubbt_SUBSCRIPTION_DATA set SUBSCRIPTION_END_DATE = '' where CUSTOM_ID = '3274be4f0f4d1acf32080bd353e9d5e6'


BUG is... ???
$newtime = strtotime("{$ubbt_lang['MONTH' . $month]} $day $year");

FIX ???
$newtime = strtotime("$day-$month-$year");

Joined: Dec 2003
Posts: 6,630
Likes: 85
Joined: Dec 2003
Posts: 6,630
Likes: 85
Looks to me you don't like the default date format. mm/dd/yyyy
and want dd/mm/yyyy that should be done in the control panel.
Not in code.
that is display general-date&time
I did not review the file though.

Last edited by Ruben; 05/25/2019 3:24 PM.

Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Apr 2019
Posts: 44
Newbie
Newbie
Joined: Apr 2019
Posts: 44
The problem is that this $ubbt_lang should not be used as a variable because this is a modifiable language variable.

Joined: Apr 2004
Posts: 1,974
Likes: 154
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,974
Likes: 154
strtotime (PHP 4, PHP 5, PHP 7)
strtotime — Parse about any English textual datetime description into a Unix timestamp
https://www.php.net/manual/en/function.strtotime.php

The strtotime() function expects to be given a string containing an English date format and will try to parse that format into a Unix timestamp (the number of seconds since January 1 1970 00:00:00 UTC),


CURRENT CODE
strtotime("{$ubbt_lang['MONTH' . $month]} $day $year");

$month is the dropdown menu value that gets translated in to the language string, as $ubbt_lang['MONTH_'] where the dropdown menu has values of 1 through 12. each representing a month

For example,
$ubbt_lang['MONTH5'] = "May";

This parses as ENGLISH format. such as:
May 26 2019


current developer of UBB.threads php forum software
current release: UBB.threads 8.0.0 // wip: UBB.threads 8.0.1
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Jul 2006
Posts: 116
Likes: 4
P
Member
Member
P Offline
Joined: Jul 2006
Posts: 116
Likes: 4
BlackMale is right. The problem is that this function will break as soon you translate the language file to a different language. The suggested fix will do the trick after any English date format including strtotime("$day-$month-$year"); (European) or strtotime("$month/$day/$year"); (US) will be converted into a Unix timestamp.

Joined: Apr 2004
Posts: 1,974
Likes: 154
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,974
Likes: 154
There are a lot of things in the core code that can be rewritten and could be improved upon. Obviously those things are already happening, but they are happening with only as much time as I am able to put in to this product, outside of family and work.


@ BlackMale -
Submissions are helpful when they include narrative.

Without narrative, it because a unpleasant guessing game of "guess what color that non-descriptive thing is." And as said times before, this is especially true when the software has had many developers in the past 20 years, and not everyone has worked on all aspects of the whole program.

Not to be mistaken, your reports are helpful. But they are often difficult to understand what you're attempting to demonstrate.

--

Please at least follow some of the expected basics when reporting a bug:
** ID/name: Keep it brief and use correct terms. A best practice is to include the name of the feature where you found an issue. A good example could be 'CART - Unable to add new item to my cart'.
** Description/summary: If you feel the name is not sufficient, explain the bug in a few words. Share it in easy-to-understand language. Keep in mind that your description might be used to search in your bug tracking application, so make sure to use the right words.
** Environment: Depending on your browser, operating system, zoom level and screen size, websites may behave differently from one environment to another. Make sure your developers know your technical environment.
** Source URL: Make it easy for your developers spot the problem by including the URL of the page where you found the bug. Big time saver!
** Visual proof: A picture is worth a thousand words. Although it might not be enough, a visual element like a screenshot or a video will help your developers understand the problem better and faster.
** Steps to reproduce: A screenshot is a proof that you had a problem, but keep in mind that your developer might not be able to reproduce the bug. Make sure to describe, with as much detail as possible, the steps you took before you encountered the bug.
** Expected vs. actual results: Explain what results you expected - be as specific as possible. Just saying "the app doesn’t work as expected" is not useful. It's also helpful to describe what you actually experienced.
** Optional: You can also include extra information such as the severity (critical, major, minor, trivial, enhancement), priority (high, medium, low), name of the reporter, person assigned or a due date.

This example was duplicated from https://marker.io/blog/tag/workflows/

Last edited by isaac; 05/27/2019 12:25 PM. Reason: clarity

current developer of UBB.threads php forum software
current release: UBB.threads 8.0.0 // wip: UBB.threads 8.0.1
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Apr 2019
Posts: 44
Newbie
Newbie
Joined: Apr 2019
Posts: 44
Due to my poor English, I can only use the simple problem when I find the problem.

Also use google translation

I hope you understand, thank you for teaching.

Joined: Apr 2004
Posts: 1,974
Likes: 154
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,974
Likes: 154
Thank you BlackMale for reporting this error, and Philipp for further explanation.

It has been fixed for UBB.threads 7.7.2

To avoid potential errors, the widely accepted date format of "YYYY-MM-DD" will be used. The $day and $month values coming from edit_user_sub.php will no longer depend on the language strings, and are now converted in to two digits going forward. (example: $day = sprintf('%02d', $day)) for passing to the strtotime() function which parses that format into the Unix timestamp.


current developer of UBB.threads php forum software
current release: UBB.threads 8.0.0 // wip: UBB.threads 8.0.1
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Jun 2006
Posts: 626
Addict
Addict
Joined: Jun 2006
Posts: 626
Originally Posted by isaac
Thank you BlackMale for reporting this error, and Philipp for further explanation.

It has been fixed for UBB.threads 7.7.2

To avoid potential errors, the widely accepted date format of "YYYY-MM-DD" will be used. The $day and $month values coming from edit_user_sub.php will no longer depend on the language strings, and are now converted in to two digits going forward. (example: $day = sprintf('%02d', $day)) for passing to the strtotime() function which parses that format into the Unix timestamp.
Is there a need for me to fix this for 7.7.1?????

Joined: Apr 2004
Posts: 1,974
Likes: 154
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,974
Likes: 154
No.

1) its not show-stopping.
2) it has no affect on forums using English as their Control Panel language.
3) An update will appear in the public release following 7.7.1.


current developer of UBB.threads php forum software
current release: UBB.threads 8.0.0 // wip: UBB.threads 8.0.1
isaac @ id242.com // my forum @ CelicaHobby.com

Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Profile avatar storage settings
by SenecaFlyer - 12/05/2024 1:24 PM
Not allowing attachment over 2m
by ehill - 12/03/2024 3:16 PM
New Admin Here
by SenecaFlyer - 12/02/2024 4:14 PM
Who's Online Now
1 members (Ruben), 1,773 guests, and 101 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.1
(Snapshot build 20240918)