Environment:
PHP 5.3.20
MySQL 5.3.29
Alfresco Enterprise 4.0.2.9

Steps to reproduce:

  1. Setup Drupal -> CMIS Synchronisation, and ensure your sync user has write privilages
  2. Create a node in Drupal and ensure that it is saved to the CMIS repository
  3. In the admin/content screen, locate the node you just created, and click the delete button, then confirm the delete
  4. An error message will now be displayed at the top of the screen indicating that there was an issue communicating with the CMIS server, followed by a green notice message informing you that the node has been deleted
  5. In the CMIS repository, the node has not been deleted

This issue tracks two things (or can be split out if required)

  1. The delete call to the CMIS repository fails
  2. When the delete in CMIS fails, the whole delete action is not atomic (or consistent), and so the Drupal side of the delete continues, regardless of the consequences
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

chalford’s picture

The first part of this issue, the node deletion failing, is caused by a capitalisation inconsistency (I'll post a patch when I can figure out how patching in Drupal works).

The second part of this issue might be more of a feature request (and isn't so simple to solve). When a delete like this fails, the current behaviour is to swallow the exception (but report on it), and let Drupal continue with the underlying node deletion. This causes inconsistency, as the CMIS repository now contains a node that has been deleted in Drupal. This can cause problems with later synchronisation runs, and is not generally desirable.

Currently, we are modifying the CMIS Sync delete hook to rethrow any exceptions in the delete process (as well as wrapping them in a transaction). This forces the module_invoke_all call to fail, throwing the error back to the original node_delete method. This method uses a db transaction, and so the node deletion is prevented. The error is then further thrown, all the way up to the UI, where a rather ugly error page is returned to the user, which doesn't present any way of navigating away.

Obviously, this method of displaying an error is not desirable. However, we need to throw an exception to node_delete in order to stop the underlying Drupal node deletion, so we may need to propose a fix to core (do any other modules require atomic node deletions?).

chalford’s picture

Patch for capitalisation fix attached, against 7.x-1.x branch.

  • b1c1cf9 committed on 8.x-1.x
    Issue #1934176 by chalford cmis call fails when deleting node in Drupal...
m1r1k’s picture

Issue summary: View changes
Status: Active » Closed (fixed)