[wp-trac] [WordPress Trac] #60072: No upper limit restriction for number of posts set via Site Editor and the value entered by the user chang

WordPress Trac noreply at wordpress.org
Thu Feb 15 05:26:53 UTC 2024


#60072: No upper limit restriction for number of posts set via Site Editor and the
value entered by the user chang
-------------------------+-------------------------------------------------
 Reporter:               |       Owner:  (none)
  jomonthomaslobo1       |
     Type:  defect       |      Status:  new
  (bug)                  |
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Themes       |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  needs-patch  |     Focuses:  ui, javascript, administration,
                         |  template, sustainability
-------------------------+-------------------------------------------------

Comment (by kgulqqjp5):

 It seems like you're encountering a bug in WordPress where there's no
 upper limit restriction for the number of posts set via the Site Editor,
 and the value entered by the user changes unexpectedly. Let's delve into
 this issue and explore potential solutions.

 ### Understanding the Problem

 1. **Bug Description**: When attempting to set a large number of posts per
 page via the Site Editor, the value entered by the user changes
 unexpectedly.

 2. **Expected Behavior**: Upon saving the changes, the system should
 either display a validation message indicating that the maximum number of
 posts allowed per page has been exceeded, or it should retain the value
 entered by the user.

 ### Investigating the Environment

 Based on the information provided, the issue occurs in the following
 environment:
 - WordPress version: 6.4.2
 - PHP version: 7.4.33
 - Server: Apache/2.4.54
 - Database: MySQL 5.7.39
 - Browser: Chrome 118.0.0.0 (macOS)
 - Theme: Twenty Twenty-Four 1.0
 - Plugins: WordPress Beta Tester 3.5.5

 ### Steps to Reproduce the Bug

 1. Navigate to the Site Editor.
 2. Modify the "No. of posts per page" option by entering a large number.
 3. Save the changes.

 ### Bug Manifestation

 The bug manifests as follows:
 - The system does not display any upper limit validation message.
 - Upon revisiting the Site Editor, the number entered by the user has
 changed to a seemingly random value (e.g., 9223372036854776000).

 ### Proposed Solution

 To address this bug, we can implement the following steps:

 1. **Implement Validation**: Enhance the Site Editor functionality to
 include validation for the "No. of posts per page" option. This validation
 should check whether the entered value exceeds the maximum allowed number
 of posts per page.

 2. **Preserve User Input**: Ensure that the value entered by the user is
 preserved even if it exceeds the maximum allowed limit. Instead of
 changing the value to a random number, display an error message informing
 the user that the entered value exceeds the maximum limit.

 3. **Bug Fix Release**: Once the validation and preservation of user input
 are implemented, release a bug fix update for WordPress (if applicable) to
 address this issue for all users.

 ### Conclusion

 By implementing validation checks and preserving user input, we can
 address the bug where there's no upper limit restriction for the number of
 posts set via the Site Editor, and the value entered by the user changes
 unexpectedly. This will enhance the user experience and ensure that users
 can set the desired number of posts per page without encountering
 unexpected behavior.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60072#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list