Automatically closed - issue fixed for 2 weeks with no activity.
Existing blocks, with a block_id.module ID attached, cannot be edited without changing the already set ID.
Remove the current block from the list of external blocks checked in block_id/block_id.module
@ W3S_validation()
@ variable $block_id
;
patch attached →
.
After applying patch, new variable $self
:
/**
* Implement w3 standards validation alter.
*/
function W3S_validation(&$form, FormStateInterface $form_state){
// Block ID field value fatch.
$inputs = $form_state->getUserInput()['third_party_settings']['block_id']['id'];
// get the id of the block being submitted
$self = isset($form['id']['#default_value']) ? $form['id']['#default_value'] : null;
if(!empty($inputs)){
// Checking id has not no space and special characters.
if ( preg_match('/[^a-zA-Z_\-0-9]/i', $inputs) ){
$form_state->setErrorByName('third_party_settings', t('Attribute ID must be unique, must not contain any space characters & must contain at least one character. Underscore (_) can be used.'));
}
// block list those using block id field.
$block_ids = \Drupal::entityQuery('block')->condition('third_party_settings', '')->execute();
// remove the block currently being submitted from the list of existing blocks so the submitted ID isn't checked as an external block ID
if ($self) { unset($block_ids[$self]); }
// Getting ID's already inserted in another block.
foreach($block_ids as $ids){
$block = Block::load($ids);
if($block->getThirdPartySetting('block_id', 'id') == $inputs){
$form_state->setErrorByName('third_party_settings', t('Attribute ID must be unique. This ID has added in another block.'));
}
}
}
}
Review attached patch → , roll it into the next release?
None.
None.
None.
Fixed
2.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Automatically closed - issue fixed for 2 weeks with no activity.