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.


Newsletter New content

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#20231 (In Topic #4718)
Avatar

Well-settled

From the Newsletter menu I clicked "New content" and got this error.

Code

 A query that had to return something returned nothing: SELECT c_name FROM ocp3_catalogue_categories WHERE (id=6) (ocPortal version: 3.0.1, PHP version: 4.4.3-dev, URL: /adminzone/index.php?page=admin_newsletter&type=whatsnew)
Here is the stack trace:

Below is a stack trace revealing the state ocPortal was in when the error occured. If this represents a bug in ocPortal's unmodified software, you may want to check ocportal.com for a fix, and if there isn't one, report this as a bug. Please note that merely posting a stack trace is not sufficient for us to solve your problem; the stack trace is just an aid that presents us with additional information. We still need to know the error message, the human situation, version numbers, and any other appropriate information.
We apologise for this problem and hope you will work with us so that we can fix it promptly.
File    '/home/rpgdfw/www/www/sources/global2.php'
Line    '690'
Function    'get_html_trace'
Args    

File    '/home/rpgdfw/www/www/sources/database.php'
Line    '342'
Function    'clean_exit'
Args    

'A query that had to return something returned nothing: SELECT c_name FROM ocp3_catalogue_categories WHERE (id=6) '

File    '/home/rpgdfw/www/www/sources/hooks/modules/admin_newsletter/catalogues.php'
Line    '35'
Function    'query_value'
Class    'database_driver'
Type    '->'
Args    

'catalogue_categories'

'c_name'

array

File    '/home/rpgdfw/www/www/adminzone/pages/modules/admin_newsletter.php'
Line    '129'
Function    'run'
Class    'hook_catalogues'
Type    '->'
Args    

0

'EN'

File    '/home/rpgdfw/www/www/adminzone/pages/modules/admin_newsletter.php'
Line    '52'
Function    'automatic_whats_new'
Class    'module_admin_newsletter'
Type    '->'
Args    

File    '/home/rpgdfw/www/www/sources/aed_module.php'
Line    '148'
Function    'run_start'
Class    'module_admin_newsletter'
Type    '->'
Args    

'whatsnew'

File    '/home/rpgdfw/www/www/sources/zones.php'
Line    '294'
Function    'run'
Class    'module_admin_newsletter'
Type    '->'
Args    

File    '/home/rpgdfw/www/www/sources/site.php'
Line    '624'
Function    'load_module_page'
Args    

'adminzone/pages/modules/admin_newsletter.php'

'admin_newsletter'

File    '/home/rpgdfw/www/www/sources/site.php'
Line    '494'
Function    'request_page'
Args    

'admin_newsletter'

true

File    '/home/rpgdfw/www/www/adminzone/index.php'
Line    '42'
Function    'do_site'
Args    
Back to the top
 
Posted
Rating:
#20232
Avatar

It looks like you have an orphaned catalogue entry. Did you delete a catalogue category with entries in, or a whole catalogue? Perhaps you got an error when you did that action so it couldn't complete properly? In theory deleting catalogues and catalogue categories should properly clean up the entries/categories within.


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:
#20288
Avatar

Well-settled

Yes, I deleted a test catagory. A few actually. I did get an error, but I didn't catch it.
Back to the top
 
Posted
Rating:
#20293
Avatar

To workaround it, change line 35 of sources/hooks/modules/admin_newsletter/catalogues.php from:

Code

         $c_name=$GLOBALS['SITE_DB']->query_value('catalogue_categories','c_name',array('id'=>$row['cc_id']));

to:

Code

         $c_name=$GLOBALS['SITE_DB']->query_value_null_ok('catalogue_categories','c_name',array('id'=>$row['cc_id']));
         if (is_null($c_name)) continue; // Corruption


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:
#98158

Honoured member

I've had this problem in V9.0.7 and apply the work around above, making a copy of the file and placing it the sources custom directory, but it didn't fix my problem.  Do I need to post the stack trace for better clearafication?  I didn't read the entire error, but it looked to be the same
Back to the top
 
Posted
Rating:
#98162
Avatar

Hi,

This was a different issue, but in the same file. I have applied a fix for you.

I think it was probably caused by a catalogue's title field being redefined after entries had already been added. It got confused when looking up older entries that did not have the new title field.


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:
#98171

Honoured member

Thanks Chris.  Works like a champ now.  Yes, I had to do some changes to one of the catalogues.  When we did the import form the other site it messed up my Links catalogue.  Instead of trying to make sense out of it all I deleted the catalogue and created a new one.  I wasn't thinking that it could cause problems down the line to another module.
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: