Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#22111 closed defect (bug) (fixed)

wp_enqueue_script stopped loading scripts

Reported by: sswells's profile sswells Owned by: ryan's profile ryan
Milestone: 3.5 Priority: normal
Severity: normal Version: 3.5
Component: General Keywords:
Focuses: Cc:

Description

I updated to 3.5-beta1-22104, and now my plugin styles are no longer being loaded. It's successfully enqueued, but is not being printed on the page. This is my code:

wp_enqueue_style('formidable-admin', FRM_URL. '/css/frm_admin.css', $frm_version);

Is this bug or has this changed?

Change History (9)

#1 follow-ups: @nacin
12 years ago

  • Milestone changed from Awaiting Review to 3.5

The fourth argument is version, not the third argument. The third argument is dependencies.

This is indeed related to a change in 3.5, but I thought we squashed this. What is the exact value of $frm_version here? var_dump() would be perfect.

#2 in reply to: ↑ 1 @nacin
12 years ago

Replying to nacin:

The fourth argument is version, not the third argument. The third argument is dependencies.

This is indeed related to a change in 3.5, but I thought we squashed this.

To clarify, just because the function was being called wrong, doesn't mean things should break when we can avoid it, if it previously worked.

#4 in reply to: ↑ 1 @sswells
12 years ago

Replying to nacin:

The fourth argument is version, not the third argument. The third argument is dependencies.

This is indeed related to a change in 3.5, but I thought we squashed this. What is the exact value of $frm_version here? var_dump() would be perfect.

Thanks so much! I missed that in my digging.

Here's a version of that line that makes more sense:
wp_enqueue_style('formidable-admin', WP_PLUGIN_URL .'/formidable/css/frm_admin.css', '1.06.05');

#5 @SergeyBiryukov
12 years ago

Since [21420], '1.06.05' is treated as an actual dependency here.

#6 follow-up: @nacin
12 years ago

I've re-opened #20683. We may need to back this out.

#7 in reply to: ↑ 6 @TobiasBg
12 years ago

Replying to nacin:

To clarify, just because the function was being called wrong, doesn't mean things should break when we can avoid it, if it previously worked.

Replying to nacin:

I've re-opened #20683. We may need to back this out.

So we pass on an enhancement (i.e. revert it), because someone has a bug in his code? That the code worked previously was pure luck, wasn't it?

#8 @nacin
12 years ago

The enqueueing and registering script/style methods have a rather complex method signature. These are understandable mistakes (I made the mistake in core, myself, breaking Plupload). A script that worked without incident in 3.4 should not suddenly disappear from the page in 3.5. It's a very cryptic bug that will cause a lot of developers a lot of headaches, and a lot of users a lot of broken sites.

Enhancements are often worth it. Here, this one is quite clearly not.

#9 @ryan
12 years ago

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

In [22286]:

Revert [21420] and [21481]. Accepting a string caused back compat problems including the possibility of revealing previously hidden circular dependencies resulting in infinite loops.

fixes #20683 #22111
see #21520

Note: See TracTickets for help on using tickets.