Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I've recently seen a new bug appear on a site running WP e-commerce. New products (or certain existing products) get stuck as 'drafts'. Once they are marked as draft clicking 'publish' does not do any good, and the only way to make the products publicly accessible is by directly editing the entry in the MySQL database.

UPDATED Further investigation shows that this is not an wp-ecommerce problem - it affects all posts.

Switching to twentyten theme fixes the problem, so clearly the inability to publish must lie somewhere in the custom theme I'm using. Seeing as it's my own theme, I guess I'm to blame ;-)

Error reporting throws up a mention of an incorrectly called register_script() function, however I don't think this is what's causing the problem, as it's not in my code.

share|improve this question
3  
Difficult to isolate problem. Its likely that (if not a setting within wp-ecommerce) that another plugin or recently added (?) piece of code may be interfering with the save_post function, somehow overwriting the publish status with draft regardless of user intent. What have you done to try and solve this thus far? Try disabling all plugins and re-testing, then enabling one plugin one-by-one to rule out plugin conflicts and whether the issue lay with the wp-ecommerce plugin itself. –  userabuser Oct 13 '12 at 4:09
    
Hi @userabuser. Disabling all plugins apart from wp-ecommerce itself had no effect unfortunately. I'm not seeing any php errors either, so I'm a bit flummoxed as to where to start. –  fred2 Oct 15 '12 at 18:53

3 Answers 3

up vote 4 down vote accepted

You probably have some custom functions in your themes functions.php Add a return; on top of this file. If the problem is solved: Move it below the first function. Proceed this way until you've found the function that is causing the problem.

If this doesn't work: Go and do the same for one template file after each other until you found the file that is causing the issue.

share|improve this answer
    
Ohh - nice idea. I'll try that. –  fred2 Oct 15 '12 at 23:56
    
This was the best procedure, and allowed me to identify the bug - which was introduced by a bit of jQuery that broke the 'publish' button. –  fred2 Oct 16 '12 at 2:36
1  
@fred2 Bounty welcome :) –  kaiser Oct 16 '12 at 3:05
1  
@kaiser Add a return; after the bounty, to me. Good suggestion ;) –  userabuser Oct 16 '12 at 7:09
1  
@fred2 Nah, just give it to "userabuser" - We need more high rep people to keep the system clean, and he is helping alot on here. :) –  kaiser Oct 16 '12 at 15:29

Is it possible that you have accidentally changed your user role from Editor to Contributor -- perhaps in your functions.php file (which is why it might only happen on your custom theme)?

Contributors roles can only save draft for new posts and can't publish. You might like to check that your didn't change anything in your custom theme so that if user can't manage options (for example), then they can't save / publish a posts.

share|improve this answer
    
I'm logged in as superadmin, but it could be that some permissions have been disrupted... –  fred2 Oct 15 '12 at 23:57

In that case your error lays with wp-ecommerce itself as you've ruled out any via process of elimination.

The last thing I would suggest you do, is switch from your current theme to the default WordPress theme (still ensuring that all plugins except wp-ecommerce are disabled) and if the problem still persists then its definitely wp-ecommerce.

We can assume this even more so because the default theme (if never altered before) will provide the best test conditions for this scenario.

i.e. no functions.php alternations etc have been made by the user that could possibly interfere with the plugin in question and since no other plugins are installed whilst running this test then we know who the problem is).

After that, if the problem persists you need to seek help from wp-ecommerce or hire a WP professional to take a look at it for you because it sounds like physical look-and-see access is going to be needed to troubleshoot this one properly unless you can provide any further information to debug.

You can try putting your WP installation into debug mode by editing your wp-config.php file and setting WP_DEBUG to true and see if any error notices are being thrown that indicate as to what the cause may be.

What is your current version of WordPress installed?

share|improve this answer
    
Thanks again. Wordpress is 3.4.2. See my updates to the question above. It does seem to be connected to my own custom theme. WP_DEBUG does not seem to indicate an obvious error in the code. I'm able to debug the code myself - main reason for posting was to see if anybody had an idea where to look in the absence of any php error reports. –  fred2 Oct 15 '12 at 21:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.