Edgewall Software
Modify

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#11799 closed defect (fixed)

First entry 8 is selected in dropdown for rows of textarea in wiki edit page by default

Reported by: Jun Omae Owned by: Jun Omae
Priority: normal Milestone: 1.0.3
Component: wiki system Version: 0.12-stable
Severity: minor Keywords:
Cc: Branch:
Release Notes:

Select 20 rows in dropdown for height of textarea in wiki edit by default.

API Changes:

Description (last modified by Jun Omae)

When a user which its session is empty, in wiki edit page, first entry 8 is selected in dropdown for height of textarea. However, height of the textarea is 20 rows.

Pressing preview button after this, the height will be 8 rows and "8" will be stored in session. The behavior is annoying me. That is introduced in [8888#file3].

  • trac/wiki/web_ui.py

    diff --git a/trac/wiki/web_ui.py b/trac/wiki/web_ui.py
    index 94e8bfc..f1af122 100644
    a b class WikiModule(Component):  
    522522            page.readonly = 'readonly' in req.args
    523523
    524524        author = get_reporter_id(req, 'author')
    525         defaults = {'editrows': 20}
     525        defaults = {'editrows': '20'}
    526526        prefs = dict((key, req.session.get('wiki_%s' % key, defaults.get(key)))
    527527                     for key in ('editrows', 'sidebyside'))
    528528

Also, the selected rows isn't stored in the user's session when the page is saved. However, if submitting changes and the changes collide against another changes, the rows will be incongruously stored in the session. See tags/trac-1.0.2/trac/wiki/web_ui.py@:155-159#L143 and tags/trac-1.0.2/trac/wiki/web_ui.py@:543-544#L529.

I think the rows should be stored even if submitting changes.

Attachments (0)

Change History (7)

comment:1 by Jun Omae, 5 years ago

Description: modified (diff)

in reply to:  description comment:2 by Ryan J Ollos, 5 years ago

Replying to jomae:

When a user which its session is empty, in wiki edit page, first entry 8 is selected in dropdown for height of textarea. However, height of the textarea is 20 rows.

Pressing preview button after this, the height will be 8 rows and "8" will be stored in session. The behavior is annoying me.

Thanks, I've felt some strange behavior here before but never stopped to study it. The patch looks good to me.

comment:3 by Jun Omae, 5 years ago

Owner: set to Jun Omae
Release Notes: modified (diff)
Status: newassigned

Thanks for the feedback. Fixed in [13204] and merged to trunk in [13205].

For 0.12.x users, please try th:TracFewFixesPlugin.

comment:4 by Jun Omae, 5 years ago

Resolution: fixed
Status: assignedclosed

comment:5 by Jun Omae, 5 years ago

Resolution: fixed
Status: closedreopened

I notice that the same issue occurs if toggling from Edit side-by-side mode on 1.0-stable. I'll fix here.

comment:6 by Jun Omae, 5 years ago

Resolution: fixed
Status: reopenedclosed

Ouch, comment:5 is not right. I've used 1.0.2 without the patch in description. Re-closing.

comment:7 by Ryan J Ollos, 5 years ago

Release Notes: modified (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted.
to The owner will be changed from Jun Omae to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.