WordPress.org

Make WordPress Core

Opened 4 months ago

Last modified 3 weeks ago

#41143 reviewing defect (bug)

Theme/plugin editing: if you don't select a function it just returns without message

Reported by: karmatosed Owned by: SergeyBiryukov
Milestone: 4.9 Priority: normal
Severity: normal Version:
Component: Themes Keywords: has-patch
Focuses: Cc:

Description

The drop down simply returns nothing, could we have a message to say something like 'please search for something'? It feels a little of a hitch in the flow otherwise.

https://cldup.com/B7kYDlxlUF.png

Attachments (3)

41143.diff (3.3 KB) - added by xkon 3 months ago.
Modified the buttons jQuery code to show / hide an error message.
41143_v2.diff (4.2 KB) - added by xkon 3 months ago.
Diff for suggestion with disabled button.
41143_v3.diff (3.4 KB) - added by xkon 3 months ago.
Disabled Button. Check code transfered to common.js

Download all attachments as: .zip

Change History (17)

#1 @karmatosed
4 months ago

  • Summary changed from Theme/plugin editing: if you don't have a function it doesn't encourage you to have one, just fails. to Theme/plugin editing: if you don't select a function it just returns without message

This ticket was mentioned in Slack in #design by karmatosed. View the logs.


4 months ago

@xkon
3 months ago

Modified the buttons jQuery code to show / hide an error message.

#3 @xkon
3 months ago

Hello,

I created a simple patch for this by just adding a span, showing it / hiding it respectively.

It's for both theme-editor.php and plugin-editor.php

Screenshot:

https://dev.xkon.gr/forum_stuff/41143.jpg

If there are more suggestions let me know to come up with something else.

Best regards,
Konstantinos

This ticket was mentioned in Slack in #core by xkon. View the logs.


3 months ago

#5 @xkon
3 months ago

  • Keywords has-patch added

#6 @swissspidy
3 months ago

What about disabling the button as long as nothing is selected?

#7 @xkon
3 months ago

Sure I could fix a version like
that @swissspidy . To clarify it will be disabled by default and then accordingly changed if there's a selection .

I'll get on it after work. Question is there a js file that loads on admin globally it would be nicer to add a function there instead of inline. I have no clue first time contributing so I don't want to add things to wrong files ..

Best regards ,
Konatantinos

@xkon
3 months ago

Diff for suggestion with disabled button.

#8 @xkon
3 months ago

Hello again,

I've added 41143_v2.diff this is @swissspidy 's suggestion to have the button disabled. I think it works better than the error message. At least it makes more sense and keeps the UI clean.

Unfortunately I added the code within the page as I don't know if I should add it to the minified common.js myself or if somebody will transfer it there.

Keep me posted if you need it in another file so I can fix an update for it.

Best regards,
Konstantinos

@xkon
3 months ago

Disabled Button. Check code transfered to common.js

#9 @xkon
3 months ago

After talking with @swissspidy ( he helped me understand the dev svn correctly, so thanks again :) ) I've added the code into common.js instead to be nice and clean for production.

Added: 41143_v3.diff

Best regards,
Konstantinos

This ticket was mentioned in Slack in #core by xkon. View the logs.


3 months ago

This ticket was mentioned in Slack in #core-themes by xkon. View the logs.


3 months ago

#12 @SergeyBiryukov
3 months ago

  • Milestone changed from Awaiting Review to 4.9
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#13 @xkon
4 weeks ago

Just dropping by in case there's an update for this as well @karmatosed / @SergeyBiryukov , i reapplied the patch and it's still working by disabling the Look Up button

This ticket was mentioned in Slack in #design by xkon. View the logs.


3 weeks ago

Note: See TracTickets for help on using tickets.