Attempting to save a node using the bypass option does not save.

Screen simply refreshes, but no saving is done until the duplicate value is fixed.

Attempted under administrator as well as bypass permission was given to the specific role.

CommentFileSizeAuthor
Bypass.PNG2.5 KBANANSFPL

Comments

ANANSFPL created an issue. See original summary.

Coupon Code Swap’s picture

Apparently, onclick is now being stripped from the t() function. Perhaps one of the recent Drupal updates. I put together a quick hack as a temporary workaround. I'm sure the maintainers can come up with a proper patch that is better.

sites/all/modules/unique_field/unique_field.module

-        if (user_access('unique_field_perm_bypass')) {
          $form_id = str_replace('_', '-', $form['#id']);
          $msg .= '<p>' . t('Click !here to bypass this check and resubmit.', array('!here' => "<a href=\"#\" onclick=\"jQuery('form#" . $form_id . " input[name=\'unique_field_override\']').val(1);jQuery('form#" . $form_id . "').submit();return false;\">" . t('here') . '</a>')) . '</p>';
        }

+                if (user_access('unique_field_perm_bypass')) {
          $form_id = str_replace('_', '-', $form['#id']);
          drupal_add_js('jQuery(document).ready(function($){$("#unique").click(function(e){jQuery("form#' . $form_id . ' input[name=\'unique_field_override\']").val(1);jQuery("form#' . $form_id . '").submit();e.preventDefault();});});',array('type'=>'inline','scope'=>'footer','group'=>JS_THEME));
          $msg .= '<p>' . t('Click !here to bypass this check and resubmit.', array('!here' => "<a id=\"unique\" href=\"#\">" . t('here') . '</a>')) . '</p>';
        }
piero.nanni@gmail.com’s picture

I've had the same issue and this patch resolved the error, thank you!

astonvictor’s picture

Status: Active » Closed (outdated)

D7 reached its EOL back in January 2025, and there is no active release for D7 for this module anymore.
Development or support is not planned for D7. All D7-related issues are marked as outdated in a bunch.

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.