| @@ -192,14 +192,8 @@ | ||
| 192 | 192 | } catch ( e ) { |
| 193 | 193 | return { success: false, error: String( e && e.message ? e.message : e ) }; |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | - const u = sharedEditorUtils(); | |
| 197 | - const refusal = u && u.postIdRefusal ? u.postIdRefusal( args ? args.post_id : undefined ) : null; | |
| 198 | - if ( refusal ) { | |
| 199 | - return { success: false, error: refusal.reason + ': ' + refusal.detail + ' (the open editor is not the post this edit was planned for)' }; | |
| 200 | - } | |
| 201 | - | |
| 202 | 196 | let clientId = resolveClientId( sel, args ); |
| 203 | 197 | if ( ! clientId ) { |
| 204 | 198 | return { success: false, error: 'no_block: the page has no blocks to attach JS to' }; |
| 205 | 199 | } |
| @@ -246,10 +240,9 @@ | ||
| 246 | 240 | // edits content shared with every other page that uses that pattern. Checked |
| 247 | 241 | // AFTER the js-capable redirect so it validates the block actually written to. |
| 248 | 242 | // Degrades to ALLOW when the selector is absent (older Gutenberg), matching |
| 249 | 243 | // assertMutable — never a false block. |
| 250 | - const aiEditable = ! ( u && u.isAiEditable ) || u.isAiEditable( sel, clientId ); | |
| 251 | - if ( ( typeof sel.canEditBlock === 'function' && sel.canEditBlock( clientId ) === false ) || ! aiEditable ) { | |
| 244 | + if ( typeof sel.canEditBlock === 'function' && sel.canEditBlock( clientId ) === false ) { | |
| 252 | 245 | return { |
| 253 | 246 | success: false, |
| 254 | 247 | error: 'locked_block: ' + clientId + ' is locked in the editor (template lock, content lock, or a synced-pattern instance), so its JavaScript cannot be changed here. Edit the pattern itself, or unlock the block.', |
| 255 | 248 | }; |