Blesta Addons Posted May 16, 2015 Report Posted May 16, 2015 HEllo when i want to install my own new module i get the fallowing error Oh noes! SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '22-' for key 'PRIMARY' on line 124 in /home/xxxxxx/public_html/blesta/lib/model.php Printing Stack Trace: #0 /home/vpsmaroc/public_html/blesta/lib/model.php(124): PDOStatement->execute(Array) #1 /home/vpsmaroc/public_html/blesta/components/record/record.php(225): Model->query('INSERT INTO `mo...', Array) #2 /home/vpsmaroc/public_html/blesta/app/models/module_manager.php(401): Record->insert('module_meta', Array, Array) #3 /home/vpsmaroc/public_html/blesta/app/controllers/admin_company_modules.php(75): ModuleManager->setMeta('22', Array) #4 /home/vpsmaroc/public_html/blesta/lib/dispatcher.php(111): AdminCompanyModules->manage() #5 /home/vpsmaroc/public_html/blesta/index.php(21): Dispatcher::dispatch('/blesta/admin/s...') #6 {main} any idea in this ? i'm using blesta 3.4.3 , new upgraded . Quote
0 Michael Posted May 16, 2015 Report Posted May 16, 2015 sounds like the module row is in the database already. Quote
0 Blesta Addons Posted May 16, 2015 Author Report Posted May 16, 2015 sounds like the module row is in the database already. no ; i have deleted all the rows, and i get the same error . it seem like it add it twice in installation process !!! the table name related here is "module_meta" , the content of the dabatabse is . module_id key value serialized encrypted 22 N; 1 0 note i can install other modules , this is just for this custom module, i knows this can be related tomy module, but it have the same class as i use always . Quote
0 serge Posted May 17, 2015 Report Posted May 17, 2015 I will say like Licensecart, it's ever in DB, but maybe if you removed in DB it's still in the cache. (mysql, php, webserver, etc...) It's look like you did an action (click), that was like a double click, I found it's can happen but being rare Quote
0 serge Posted May 17, 2015 Report Posted May 17, 2015 other, even if you removed the row in DB, it's look like the previous ID can be still re-used at next insert? or new entry will be inserted using the next ID? Normaly I think it should be second case, but you could double check in real for you. Not certain about it but it's like if the module id is not really a primary key, you could double check that Quote
0 Blesta Addons Posted May 17, 2015 Author Report Posted May 17, 2015 other, even if you removed the row in DB, it's look like the previous ID can be still re-used at next insert? or new entry will be inserted using the next ID? Normaly I think it should be second case, but you could double check in real for you. Not certain about it but it's like if the module id is not really a primary key, you could double check that is not a double click . and is not related to databse . other modules installed without any probleme , i have removed all the function in my class , i let just the manage module classes . is very strange , is not my first module, if i remember well ihave done more than 20 modules , and the same logic, classes !!! i will try to debug more , but if blesta staff has a road to save me some hours of search/test is better . Quote
0 Tyson Posted May 18, 2015 Report Posted May 18, 2015 it seem like it add it twice in installation process !!! the table name related here is "module_meta" , the content of the dabatabse is . module_id key value serialized encrypted 22 N; 1 0 Can you provide the meta data you are using (which is being inserted as duplicate)? What is the value of each `key`? It sounds like you may be adding multiple meta records for the module, and some may have the same key, which causes a duplicate key entry error. Both the `module_id` and the `key` make up the primary key, so each `key` must be unique for the same module. serge and Michael 2 Quote
0 Tyson Posted May 18, 2015 Report Posted May 18, 2015 The meta data is added during a POST request from the manage page of the module. You would need to check the POST data being submitted from that page. serge 1 Quote
0 Blesta Addons Posted May 23, 2015 Author Report Posted May 23, 2015 The meta data is added during a POST request from the manage page of the module. You would need to check the POST data being submitted from that page. i have back today to this project . the manage page , you referrer to the manage.pdt ? i don't send any request . i will begin from the scratch again . Quote
0 Blesta Addons Posted May 23, 2015 Author Report Posted May 23, 2015 i cant' also uninstall the module ?!! where is this metadata ? Quote
0 Tyson Posted May 27, 2015 Report Posted May 27, 2015 where is this metadata ? What does your module's install() method return? Those fields are set as the meta data. Quote
0 Tyson Posted May 27, 2015 Report Posted May 27, 2015 i cant' also uninstall the module ?!! Why not? Quote
0 Blesta Addons Posted May 27, 2015 Author Report Posted May 27, 2015 What does your module's install() method return? Those fields are set as the meta data. the install fucntion just search if the curl exist in php . Why not? i don't know why .... i have created a nother module from scratch and is working now . Quote
Question
Blesta Addons
HEllo
when i want to install my own new module i get the fallowing error
Oh noes!
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '22-' for key 'PRIMARY' on line 124 in /home/xxxxxx/public_html/blesta/lib/model.php
Printing Stack Trace:
#0 /home/vpsmaroc/public_html/blesta/lib/model.php(124): PDOStatement->execute(Array)
#1 /home/vpsmaroc/public_html/blesta/components/record/record.php(225): Model->query('INSERT INTO `mo...', Array)
#2 /home/vpsmaroc/public_html/blesta/app/models/module_manager.php(401): Record->insert('module_meta', Array, Array)
#3 /home/vpsmaroc/public_html/blesta/app/controllers/admin_company_modules.php(75): ModuleManager->setMeta('22', Array)
#4 /home/vpsmaroc/public_html/blesta/lib/dispatcher.php(111): AdminCompanyModules->manage()
#5 /home/vpsmaroc/public_html/blesta/index.php(21): Dispatcher::dispatch('/blesta/admin/s...')
#6 {main}
any idea in this ?
i'm using blesta 3.4.3 , new upgraded .
13 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.