welcome-notice.js: the dismiss callback is sent as POST data, and `attr( 'disabled', true )` warns on WordPress 7.2
還沒有人認領這個 Issue。
評估
- 難度
- 1/5
- 預估耗時
- 1 小時以內
- 新手友好度
- 92/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- javascript, jquery
- 領域
- frontend
研究方向
開啟 assets/js/src/welcome-notice.js:關閉請求建構於第 61–65 行附近,安裝按鈕在第 48 行附近被停用。將 success: hideAndRemoveNotice 從 $.post 資料物件中移出,並用 .done( hideAndRemoveNotice ) 附加,然後將 installBtn.attr( 'disabled', true ) 改為 .prop( 'disabled', true )。若要驗證,請在開啟 SCRIPT_DEBUG 的情況下載入歡迎通知並關閉它,檢查通知僅在請求成功後消失,以及點擊 Install & Activate Otter Blocks 時 jQuery Migrate 不再發出警告。
由索引模型根據 Issue 內容生成。
描述
What's wrong
Two small problems in assets/js/src/welcome-notice.js. Neither breaks the notice today.
-
Dismiss. Lines 61–65:
$.post( ajaxUrl, { nonce, action: 'fork_dismiss_welcome_notice', success: hideAndRemoveNotice, } );successis inside the data object, not passed as a callback. When jQuery serializes data it calls any function it finds, sohideAndRemoveNotice()runs immediately when the request is built, and the request carries an emptysuccess=field. As a result, the notice disappears even if the dismissal is not saved (for example after an expired nonce), and then comes back on the next page load. Found by reading the code. -
Disabled button. Line 48,
installBtn.attr( 'disabled', true );. WithSCRIPT_DEBUGon, WordPress 7.2's jQuery Migrate 3.6 logsJQMIGRATE: Boolean attribute 'disabled' is not set to its lowercased namewhen Install & Activate Otter Blocks is clicked. Seen on 7.2-RC2; the install still completes. WordPress plans to move to jQuery 4 in 7.3.
Suggested fix
$.post( ajaxUrl, { nonce, action: 'fork_dismiss_welcome_notice' } ).done( hideAndRemoveNotice );
and installBtn.prop( 'disabled', true );.
- 主要語言
- PHP
- 星號
- 0
- 分支
- 0
- 平均合併
- 1 小時 2 分鐘
- 30 天內合併 PR
- 5
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 沒有貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
Codeinwp/fork 的其他 Issue
-
難度 1/5 1 小時以內 新手友好度 88/100
-
難度 1/5 1 小時以內 新手友好度 86/100
-
難度 2/5 1-3 小時 新手友好度 82/100
-
難度 2/5 1-3 小時 新手友好度 78/100
-
難度 1/5 1 小時以內 新手友好度 88/100
相似的 Issue
-
Change: check an identifier filter the same way in every tool - the order of somcp_search_orders未關閉consistency enhancement Orders
難度 1/5 1 小時以內 新手友好度 88/100
novalo-dev/Prestashop-MCP-Server#343 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
claude
難度 2/5 1-3 小時 新手友好度 72/100
sprain/sprainocchio#45 ·
維護者通常 1 天內回覆
-
sync-en
難度 1/5 1 小時以內 新手友好度 85/100
維護者通常 1 天內回覆
-
sync-en
難度 1/5 1 小時以內 新手友好度 85/100
維護者通常 1 天內回覆