Database error

Begonnen von le Chaland, 05 November 2023, 22:39:21

⏪ vorheriges - nächstes ⏩

0 Mitglieder und 1 Gast betrachten dieses Thema.

le Chaland

Hello  :BD: .

When i want to save a link (a file) in the download section in admin, i have this message :

Database Error (modAddNewData)

Field 'lid' doesn't have a default value

I deleted all the tables with the downloads prefix in the database and launched an update. Script wrote missing tables and detected no more error ...

I created succesfully a category.

Any idea ? Another table is corrupted ?

Here a screenshoot of the database. Hoping this is the good table ...



Thank you  :mad2:


Olaf

again the question: which pragma version
Please always specify: PragmaVersion, PHP.Version, MySQL version

The error can still occur in a version older than V2.8.
please update
g

Olaf

Kein Support über PN, Mail etc.!
Bitte die Fragen im Forum stellen, nur so helfen die Antworten auch den anderen Usern.
Bitte auch die Boardsuche nicht vergessen, oft ist genau dein Problem schon an anderer Stelle gelöst worden!

le Chaland

Sorry, you are right. My mind was too much in the problem and i forgot the essential.


All in one place :





le Chaland

#3
Okay, here what i tried :

With myoos Dumper i edited the lid key in the downloads table :

Defined as primary and added auto-increment propertie.

Result :

I can add and save in the database the files succesfully, they appears in the apropriate category in the download section and seems succesfully indexed.
For the first one :  modules.php?name=Downloads&op=view&lid=1
Tried with 3 files.

New Problem :

When i try to edit one of the 3 files, first i have a message that changes are succesfully saved but quickly after an error :
download id 0 not found...This link in the toolbar of the web browser wich is displayed :
admin.php?op=Downloads/ModData&lid=2 [file #2, correct]
When i click on "back" link i have another error that the webpage is not reachable. The link who make the error :
admin.php?op=Downloads/ModDataSave
If i use the back button of the web browser, no problem.

More strange, changes are saved succesfully ...

If you need screenshots of the downloads table or a sql backup of this inclued the key i modified, just let me know.

After i edited commented these lines in the admin.php file of the module :
    /*
    if (empty($row['lid'])) {
        mxErrorScreen('download id ' . intval($lid) . ' not found...');
    }
    */

Now i can modify and save any download without error, but :

When the script automatically goes back to the file which is edited, all fields are empty.

Hoping this can help.

le Chaland

The next ,,,

The link in the toolbar of the web browser that give empty fields:
admin.php?op=Downloads/ModData&lid=3
where this one, working, should be better :
admin.php?op=Downloads/ModData&lid=3

I don't know if modifications that i made are global good ideas but this seems working at the minimum, i think.

For sure you can do a better job.

Let me know if you need more things to resolve totally the problem(s).

Sincerly.

Nouvelle

Also, ich habe bei mir den Fehler entdeckt, das in der Datenbank der Primärschlüssel nicht vergeben wurde.

Also leere deine _download_download Datenbank
// PREFIX anpassen
TRUNCATE TABLE `PREFIX_downloads_downloads`

Und setzte den Primärschlüssel
// PREFIX anpassen
ALTER TABLE `PREFIX_downloads_downloads` CHANGE `lid` `lid` INT(11) NOT NULL AUTO_INCREMENT, add PRIMARY KEY (`lid`);

Die Fehlermeldung (ist richtig) kannst du dann wieder auskommentieren
    if (empty($row['lid'])) {
        mxErrorScreen('download id ' . intval($lid) . ' not found...');
    }
Kein Support über PN, Mail !
Bitte die Fragen im Forum stellen, nur so helfen die Antworten auch den anderen Usern.
Bitte auch die Boardsuche nicht vergessen, oft ist genau dein Problem schon an anderer Stelle gelöst worden!

Nouvelle

admin.php?op=Downloads/ModData&lid=3


kann ich nicht nachvollziehen, wie bist du dorthin gekommen ?
Kein Support über PN, Mail !
Bitte die Fragen im Forum stellen, nur so helfen die Antworten auch den anderen Usern.
Bitte auch die Boardsuche nicht vergessen, oft ist genau dein Problem schon an anderer Stelle gelöst worden!

le Chaland

#7
admin.php?op=Downloads/ModData&lid=3

I did not know how this happend, this happend every time and i make nothing of special to obtain this.

Do you have an idea to correct the string, where is called this link in the cms ?

I had not been careful, my last experience with Pragmamx is with version 1.X and I thought it was a new design of the CMS, but I have such a behavior in other parts of the administration. This requires more tests on my part to be complete, and the opening of a new dedicated topic. One thing at a time ...

le Chaland

Zitat von: Nouvelle am 07 November 2023, 21:34:54Also, ich habe bei mir den Fehler entdeckt, das in der Datenbank der Primärschlüssel nicht vergeben wurde.

Also leere deine _download_download Datenbank
// PREFIX anpassen
TRUNCATE TABLE `PREFIX_downloads_downloads`

Und setzte den Primärschlüssel
// PREFIX anpassen
ALTER TABLE `PREFIX_downloads_downloads` CHANGE `lid` `lid` INT(11) NOT NULL AUTO_INCREMENT, add PRIMARY KEY (`lid`);

Die Fehlermeldung (ist richtig) kannst du dann wieder auskommentieren
    if (empty($row['lid'])) {
        mxErrorScreen('download id ' . intval($lid) . ' not found...');
    }

I will try later, not the time now, and come back to give you the results ...

le Chaland

Hello 🙂.

Following your instructions i did the job on the database and this done :



After i restored this part of the code in admin.php file of the module :

if (empty($row['lid'])) {
        mxErrorScreen('download id ' . intval($lid) . ' not found...');
    }

For now, i can succesfully add a download.

But when i want to modify an existing download, i get this error :



When i click on the 'return' link it dones this :



So i disabled a new time the part of the code and when i want to modify a download, when saving, firstly i have the confirmation and immediatly after the pages goes here :



It seem's that, after the database bug, the problem come now from the string amp; that is inserted in the url.

If we find the source of this behaviour, maybe it will work correctly ...

Do you have an idea of the file where i could check ?

Thanks in advance.

Nouvelle

#10
* The problem is not the Themes
* is the "&"

ZitatBut when i want to modify an existing download, i get this error
* Where you klick ?
* What you use ? Mobile ? Handy ? PC ? Emulator ?
* Which browser ?
* Maybe show us your setting of the Modul



Kein Support über PN, Mail !
Bitte die Fragen im Forum stellen, nur so helfen die Antworten auch den anderen Usern.
Bitte auch die Boardsuche nicht vergessen, oft ist genau dein Problem schon an anderer Stelle gelöst worden!

le Chaland

I click on the button "Modifier". The boutton that is affected to this action.

I am working on a tablet samsung galaxy tab S7, android 10.

Same problem on browsers : Opéra, chrome, firefox, edge. Desktop view or mode activated.

Here is the config of the module :


Nouvelle

Das ist jetzt nur für dich :-)

Suche in der 'modules/Downloads/admin/admin.php'
<td>' . mx_strftime(_SHORTDATESTRING, mxSqlDate2UnixTime($date)) . '</td>
<td class="nowrap align-center">
' . modCheckPopupLink($url, $img_check) . '
<a href="' . adminUrl(PMX_MODULE, 'ModData', 'lid=' . $lid) . '">' . $img_edit . '</a>

Hier ändern wir nur den Link
<a href="admin.php?op=' . PMX_MODULE . '/ModData&lid=' . $lid . '">' . $img_edit . '</a>
Kein Support über PN, Mail !
Bitte die Fragen im Forum stellen, nur so helfen die Antworten auch den anderen Usern.
Bitte auch die Boardsuche nicht vergessen, oft ist genau dein Problem schon an anderer Stelle gelöst worden!

le Chaland

I just replaced the url as you advise, but nothing change and i must again disable the part of the code to avoid the error when changing a download ...

Now take a look here please, the problem maybe more global :

Here the list of the downloads :



And now check the url when i modiffy the category :



This is the same behavior :

- Changes are made and recorded succesfully.
- Immediatly there is the confirmation message.
- And this is just after, when the page reload and the script goes to next step that the url is corrupted.

le Chaland

I made another test.

Take a look when i modify an user, my account. Somes parts are erased for security.



And the result when i want to save or update account datas :



I wonder if the problem is really in the downloads module ?

Same things, changed are succesfully saved and after come the errors ...

le Chaland

Moving to php 7.4 or 8.1 does not resolve the issues.

Nouvelle

Dein Problem ist in der "includes/mx_api.php" "function adminUrl()"

Habe hier gerade getestet - Da ist kein Fehler

Nachdem das ja bei dir global auftaucht .... hmm mir fällt dazu nix ein
Kein Support über PN, Mail !
Bitte die Fragen im Forum stellen, nur so helfen die Antworten auch den anderen Usern.
Bitte auch die Boardsuche nicht vergessen, oft ist genau dein Problem schon an anderer Stelle gelöst worden!

le Chaland


le Chaland

#18
New complete fresh install on another server :

Re-downloaded original setup files.
Installing without any extra addon,plugin, or module ...



Same thing 🙄 ...



And too, tried to change language. No effects ...

le Chaland

I try to clean the url in the function :

$qry = str_ireplace('amp;', '', $qry);
return 'admin.php' . $qry . $anchor;

But this is the same :

https://coslcb.club/admin.php?op=users/modify&amp;chng_uid=2

Or :

$qry = str_ireplace($arg_separator, '', $qry);

Done :

https://coslcb.club/admin.php?op=users/modifychng_uid=2

Where is the next step after the function is executed that i can check if i can make a workaround ?