HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Adding a Download - Error

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#34989 (In Topic #7912)
Joe
Avatar

Honoured member

I get this error once I submit a new download:

Unfortunately a query has failed [INSERT INTO ocp_group_category_access (module_the_name, category_name, group_id) VALUES ('images', 'download_2', 1)] [Duplicate entry 'images-download_2-1' for key 1] (ocPortal version: 3.2.4, PHP version: 4.4.7, URL: /cms/pg/cms_downloads/_ad/index.php&uploading=1)

here is the stack trace

File      '/home/public_html/sources/global2.php'
Line    '728'
Function    'get_html_trace'
Args    

File    '/home/public_html/sources/database/mysql.php'
Line    '171'
Function    'clean_exit'
Args    

object

File    '/home/public_html/sources/database.php'
Line    '627'
Function    '_db_query'
Args    

'INSERT INTO ocp_group_category_access (module_the_name, category_name, group_id) VALUES (\'images\', \'download_2\', 1)'

array

NULL

NULL

false

false

File    '/home/public_html/sources/database.php'
Line    '323'
Function    '_query'
Class    'database_driver'
Type    '->'
Args    

'INSERT INTO ocp_group_category_access (module_the_name, category_name, group_id) VALUES (\'images\', \'download_2\', 1)'

NULL

NULL

false

false

File    '/home/public_html/sources/downloads2.php'
Line    '356'
Function    'query_insert'
Class    'database_driver'
Type    '->'
Args    

'group_category_access'

array

File    '/home/public_html/cms/pages/modules/cms_downlo
ads.php'
Line    '431'
Function    'add_download'
Args    

2

'Nightlife Sims'

'uploads/downloads/46e59c91a62b2.zip'

'
This is a large-sized Transparent Sim, meaning Sims with transparent backgrounds allowing you to add them to your website banners with ease. The download contains a .PSD file which requires Adobe Photoshop if editing.'

'Joe'

''

NULL

1

1

1

1

''

'TS_ID_2.zip'

0

0

1

File    '/home/public_html/sources/aed_module.php'
Line    '448'
Function    'add_actualisation'
Class    'module_cms_downloads'
Type    '->'
Args    

File    '/home/public_html/sources/aed_module.php'
Line    '157'
Function    '_ad'
Class    'module_cms_downloads'
Type    '->'
Args    

File    '/home/public_html/sources/zones.php'
Line    '324'
Function    'run'
Class    'module_cms_downloads'
Type    '->'
Args    

File    '/home/public_html/sources/site.php'
Line    '643'
Function    'load_module_page'
Args    

'cms/pages/modules/cms_downloads.php'

'cms_downloads'

File    '/home/public_html/sources/site.php'
Line    '514'
Function    'request_page'
Args    

'cms_downloads'

true

File    '/home/public_html/cms/index.php'
Line    '42'
Function    'do_site'
Args

The download does however seem to make it in the downloads section. :P

Back to the top
 
Posted
Rating:
#34993
Joe
Avatar

Honoured member

Odd. I got this error when submitting the first few downloads, but then I added about six more and didn't get the error. o_O

Back to the top
 
Posted
Rating:
#35010
Joe
Avatar

Honoured member

Also, I get this error after editing a download category:

A query that had to return something returned nothing: SELECT parent_id FROM ocp_download_categories WHERE (id=0) (ocPortal version: 3.2.4, PHP version: 4.4.7, URL: /cms/pg/cms_downloads/__ec/index.php&uploading=1)

Back to the top
 
Posted
Rating:
#35026
Avatar

For the first problem… Is it possible you've made some database changes, such as manually deleting rows, or importing rows from another database?

The second problem… It looks like something has corrupted in the database. You seem to have a download category with a parent of 0 instead of NULL. This can happen if data is imported into mySQL incorrectly (I know some import/export tools will do this).


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#35027
Joe
Avatar

Honoured member

The only editing I've ever done in the Database is deleting a zone that normally wouldn't delete via the Adminzone.

I used phpMiniAdmin to export the database on my old server and also used it to import the database information onto the new server. The script was highly recommended by someone on a web development site. Anyhow, how can I fix it?


Back to the top
 
Posted
Rating:
#35031
Avatar

1)

Somehow permissions for the 1st download's gallery existed before that download was added (but the gallery itself did not). I'm not sure how that could have come to be then, but it's not usual.

2)

Edit the row in the download_categories table that has the zero in the parent_id field so it is ticked as NULL.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: