timschofield / webERP

webERP Accounting and Business Administration ERP system
https://www.weberp.org
GNU General Public License v2.0
25 stars 112 forks source link

v4.15.2: Unknown date format when clicking on any date on AuditTrail.php #242

Open pakricard opened 1 day ago

pakricard commented 1 day ago

Hi:

On v4.15.2 AuditScript.php script, clicking on any date field:

image

A) returns the error "unknown date format" B) It shows to the user the default date format. I think it should be shown for debugging purposes only.

regading the error:

echo '<tr>
        <td>' .  _('From Date') . ' ' . $_SESSION['DefaultDateFormat']  . '</td>
        <td><input tabindex="1" type="text" class="date" name="FromDate" size="11" maxlength="10" autofocus="autofocus" required="required" value="' .$_POST['FromDate']. '" onchange="isDate(this, this.value, '."'".$_SESSION['DefaultDateFormat']."'".')"/></td>
    </tr>
    <tr>
        <td>' .  _('To Date') . ' ' . $_SESSION['DefaultDateFormat']  . '</td>
        <td><input tabindex="2" type="text" class="date" name="ToDate" size="11" maxlength="10" required="required" value="' . $_POST['ToDate'] . '" onchange="isDate(this, this.value, '."'".$_SESSION['DefaultDateFormat']."'".')"/></td>
    </tr>';

If using the latest AuditTrail.php from GitHib (commit :: IDE-assisted Debugging - casual code scanning :: on 23 oct 2024)

image

It does not show the dates with the correct format $_SESSION['DefaultDateFormat'] (d/m/Y in my case) and when trying to change any of the dates:

image

it requests to be in SQL format.

timschofield commented 11 hours ago

I am a bit confused with this one Ricard. I changed the date fields to use the browsers HTML5 date picker. I have just tried it in Firefox/Chromium/Opera and they all work fine. What browser are you using? Have you tried a ctrl-f5 to reload all javascript and css?

Thanks Tim

timschofield commented 4 hours ago

I have been thinking about this. Is it one of your modified scripts? If so it will need amending to use the new date picker as I removed the old one.

thanks Tim

pakricard commented 2 hours ago

Hi @timschofield:

My working workflow is: 1) created a testing installation that was copied from my production installation, pointing to a testing database (as copied from production) and changed PHP version to 8.2.25 2) downloaded webERP 4.15.2 files on local PC 3) For all weberp files that I didn't modify, I take one by one:

In this case: AuditTrail.php tested was 4.15.2 on my first screenshot and the latest from GitHib on the second one. I also updated the MiscFunctions.js script from v4.15.2 Tested it in Chrome, Firefox, Edge My default date locale is d/m/Y

On the demo, it shows the icon for the date picker and the hover text "show date picker", but not on my test with AuditTrail v4.15.2 script

Is there anything I might be overlooking here?