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

matslats’s picture

Status: Active » Closed (works as designed)

This 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.

orcimax’s picture

Version: 6.x-1.x-dev » 6.x-2.1
Status: Closed (works as designed) » Active

I'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?

matslats’s picture

Priority: Normal » Major
Status: Active » Fixed

Transactions 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'");

orcimax’s picture

Thank 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!

matslats’s picture

WIth 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!

orcimax’s picture

Status: Fixed » Active

The 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.

matslats’s picture

Ok 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.

orcimax’s picture

Thanks 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.

matslats’s picture

I 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.

matslats’s picture

Status: Active » Closed (won't fix)