WordPress.org

Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#10131 closed defect (bug) (fixed)

Catch-all, 2.8.1 Notice Ticket

Reported by: sirzooro Owned by:
Milestone: 2.9 Priority: normal
Severity: normal Version: 2.8
Component: Warnings/Notices Keywords: has-patch
Focuses: Cc:

Description

Notice: Undefined variable: time_since in C:\wordpress28.local\wp-content\themes\default\single.php on line 34

This message is displayed when WP 2.8 (with pl_PL translation) uses default template and you open post page.

Attachments (3)

default-widgets.patch (2.8 KB) - added by mrmist 11 years ago.
patch for notices in ticket #10225
upload.patch (471 bytes) - added by mrmist 11 years ago.
patch for notices in ticket #10223
admin-footer.patch (520 bytes) - added by mrmist 11 years ago.
Fix for admin-footer missing variable warning on discussion settings submit

Download all attachments as: .zip

Change History (20)

#1 @Denis-de-Bernardy
11 years ago

  • Component changed from Template to Warnings/Notices

#2 @sirzooro
11 years ago

I am testing my plugins to make sure they will work with WP 2.8, and found few more notices. They appear when you add new Categories widget, and are displayed one time only.

Notice: Undefined index: count in C:\wordpress28.local\wp-includes\default-widgets.php on line 486
Notice: Undefined index: hierarchical in C:\wordpress28.local\wp-includes\default-widgets.php on line 487
Notice: Undefined index: dropdown in C:\wordpress28.local\wp-includes\default-widgets.php on line 488

Probably there will be more :)

#3 @sirzooro
11 years ago

As I promised ;)

One-time notice when you add a Tag Cloud widget:
Notice: Undefined index: title in C:\wordpress28.local\wp-includes\default-widgets.php on line 986

One-time notices when you add Recent Posts widget:
Notice: Undefined index: title in C:\wordpress28.local\wp-includes\default-widgets.php on line 580
Notice: Undefined index: number in C:\wordpress28.local\wp-includes\default-widgets.php on line 581

One-time notices when you add Text widget:
Notice: Undefined index: filter in C:\wordpress28.local\wp-includes\default-widgets.php on line 409

#4 @peaceablewhale
11 years ago

  • Keywords reporter-feedback added

From single.php:

/* This is commented, because it requires a little adjusting sometimes.
You'll need to download this plugin, and follow the instructions:

http://binarybonsai.com/wordpress/time-since/ */
/* $entry_datetime = abs(strtotime($post->post_date) - (60*120)); echo time_since($entry_datetime); echo ' ago'; */

Since the code is commented out, it doesn't make sense for PHP to generate a Notice. Would you check your code?

#5 @Denis-de-Bernardy
11 years ago

  • Keywords reporter-feedback removed
  • Priority changed from normal to high
  • Summary changed from Notice: Undefined variable: time_since to Catch-all, 2.8.1 Notice Ticket

it's still there as an example, so we should probably fix it. the other widgets notices are valid.

#6 @sirzooro
11 years ago

@peaceablewhale: this is line 34 from single.php in archive with pl_PL translation:

<?php printf(__('This entry was posted %1$s on %2$s at %3$s and is filed under %4$s.', 'kubrick'), $time_since, get_the_time(__('l, F jS, Y', 'kubrick')), get_the_time(), get_the_category_list(', ')); ?>

Main archive (non-localized) doesn't have this problem.

#7 @sirzooro
11 years ago

Two more notices, after upgrade from 2.7.1 to 2.8:
Notice: Undefined index: title in C:\wordpress.local\wp-includes\default-widgets.php on line 181
Notice: Undefined index: wp_inactive_widgets in C:\wordpress.local\wp-admin\widgets.php on line 105

#8 @Denis-de-Bernardy
11 years ago

those two are covered in the other notice ticket, I believe.

#9 @mrmist
11 years ago

Yeah I didn't see this thread when I created my tickets, so see also

#10223
#10225

Which have patches.

@mrmist
11 years ago

patch for notices in ticket #10225

@mrmist
11 years ago

patch for notices in ticket #10223

@mrmist
11 years ago

Fix for admin-footer missing variable warning on discussion settings submit

#10 follow-up: @mrmist
11 years ago

Added admin-footer patch which is for a missing variable warning when the discussions options page is changed. (against 11653)

#11 @mrmist
11 years ago

  • Keywords has-patch added

#12 in reply to: ↑ 10 @westi
11 years ago

Replying to mrmist:

Added admin-footer patch which is for a missing variable warning when the discussions options page is changed. (against 11653)

I don't think this is necessary currently in trunk as it is always set - even if to a blank string in admin-header.php and doesn't trigger a notice for me.

#13 @westi
11 years ago

  • Milestone changed from 2.8.5 to 2.9

#14 @hakre
11 years ago

Realted: #10758

I experienced the footer thing as well:
https://core.trac.wordpress.org/attachment/ticket/10758/10758-wp-admin-admin-footer.patch

Since that was an intensive session, I'm pretty shure that warning appeared under multiple circumstances.

I will update the others ticket patches into one against current trunk to make it more useable.

#15 @ryan
11 years ago

(In [12337]) Include admin-footer in options.php only for the default case. Avoids warning about hook_suffix not being set when POSTing to options.php. see #10131

#16 @ryan
11 years ago

  • Priority changed from high to normal

#17 @markjaquith
11 years ago

  • Resolution set to fixed
  • Status changed from new to closed

Closing this one up for 2.9. Please open a new tickets for any more notice issues! Thanks everyone for your sleuthing.

Note: See TracTickets for help on using tickets.