Closed (won't fix)
Project:
Community Accounting
Version:
6.x-2.1
Component:
Transactions
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 Dec 2009 at 20:49 UTC
Updated:
24 Feb 2012 at 16:51 UTC
All transactions created by transaction/add are set to unpublished, although the Transaction Content Type is set to "publish by default". Transactions created by node/add/transaction respect the "publish/unpublish" preference.
Comments
Comment #1
matslats commentedThis is a design decision, to reduce the chance that unauthorised persons can see transactions.
It should not prevent authorised people seeing transactions though, because the access rights are handled in the module's own hook_access function.
If the nodes not being published is causing a problem, please report that problem.
Comment #2
orcimax commentedI'm using Mutual Credit module version 6x2.1 and Drupal core version 6.20. In my environment, transactions are set to PUBLISH by default and even when changing content type to "unpublish by default", the setting has no effect, transactions are always set to PUBLISH. This is a security issue, because all users can see other users' transactions via the tracker. It is however possible, after the transaction is completed, to set node as unpublish. How to correct that?
Comment #3
matslats commentedTransactions have their own access callback, so I judged that the published status didn't matter.
But I hadn't thought of the tracker...
To make exchange nodes unpublished by default, do this once:
variable_set('node_options_exchange', array());to do so retrospectively, do this once:
db_query("UPDATE {node} SET status = 0 WHERE type = 'exchange'");Comment #4
orcimax commentedThank you very much Matslats, this is exactly what I was looking for. However, if I’m more familiar with SQL query, I’m not so good with PHP. Can you tell me where should I add the variable_set('node_options_exchange', array()); PHP code? I guess it might go in one of the module’s file, but I’m not sure which one and where in the file exactly.
By the way, thank you very much for this module, it will really dynamize a whole service exchange community here!
Comment #5
matslats commentedWIth the devel module installed you can go to devel/php and run the command from there.
you can also go to devel/variable to edit variables directly
Or you can put these commands in the php somewhere, just to run once.
Try editing index.php and putting these commands at the bottom. Don't forget to delete them after!
Comment #6
orcimax commentedThe execution of the PHP command in the Devel module didn't solve this issue. As mentionned, unchecking the PUBLISH chekbox in the content type does not set new exchanges to UNPUBLISH by default. Does the PHP command is different than setting the content type manually? It seems that the creation of a new exchange doesn't take into account the PUBLISH setting of the content type.
Comment #7
matslats commentedOk I see what happened. The node status field in the database defaults to TRUE, so we have to explicitly set the node status to 0 in the transaction form.
This is committed to 6.x-2.x (Check the date before you download)
Let me know.
Comment #8
orcimax commentedThanks Matslats. The 6.x-2.x version solved my problem, but the issue is still not completly solved. Transactions are now unpublished by default but the opposite effect appeared. If someone wants to publish the transactions by default, he can't because the creation of a new exchange doesn't reflect the 'publish' setting of the content type. I think you should send to the database all workflow values (Published,
Promoted to front page, Sticky at top of lists, Create new revision) set by the user instead of sending hardcoded values.
Comment #9
matslats commentedI don't think this is ever going to get to the top of my priority list
I haven't used the node_revisions for transactions
Please send a fix or wait for 7.x-3.1 where as an entity, these issues will not apply.
Comment #10
matslats commented