This is a bug report filed in response to issue #699954: Disable Hiding of Click to Edit.

There is currently no way to edit an empty field because the [edit] button disappears and doesn't come back.

Instead of (or in addition to) the [edit] button, we could implement a (e.g. grey, color to be determined by CSS) box similar to those on editable pdfs. Clicking on the box will enable you to edit the field.

Comments

markfoodyburton’s picture

This is horrid either way - if you want click to edit, but there is nothing to edit.... then what should you click.
In many cases, empty fields just dont show anything.... so the thing disappears... (Further more, I'm not sure how I would force it to at least have the 'edit' appear - there is just nothing there to attach to... I guess the only thing to do is opt for a permanently editable field in this case? - or dont allow a option.....

Sorry :-(

If anybody could come up with a nice solution to this, I'd be happy to implement it...

LEternity’s picture

StatusFileSize
new26.22 KB
new28.93 KB

I finally got my "grey field" solution to work (see png). The code behind it isn't pretty (yet), but it works.

In addition to the changes I made in editablefields.js (see attached patch), the following CSS editing was necessary (and this will vary somewhat depending on your site's layout):

Edit div.editablefields_clicktoedit_message

  • specify width and height
  • specify background color (in this case #CCC) and make sure the color (i.e. font color) is the same. This is only a very basic workaround, since I didn't want to get rid of the "[edit]" label
  • make sure grey box is in the right position utilizing the margin properties
  • I would be very grateful to any improvements of this code or any ideas to achieve the same goal in a more graceful way.

    LEternity’s picture

    Status: Active » Needs review
    markfoodyburton’s picture

    Hi LEternity,
    For the patch file, I'm not sure whats happened, but it's taken the whole file as a patch - maybe you have changed the spaces or new lines - you should be able to get it to ignore white space changes - it woudl help in reviewing it...

    Also, what worries me is that this will only work if drupal spits something out for the field. In some cases, if the field is empty, you will get nothing at all?

    Cheers

    Mark.

    LEternity’s picture

    StatusFileSize
    new2.49 KB

    Mark,

    Here's a much cleaner patch. This works regardless of whether the field is empty :). It always creates a grey box like in the png file posted above.

    Thanks for the quick response!

    markfoodyburton’s picture

    Hi, I've tried this patch, but I dont see exactly how it's supposed to work - and for me, it makes things worse?

    I loose the '[edit]' buttons altogether - but, anyway, I dont see how this helps with an empty field? Surely something will have to be fixed in the module itself?

    Sorry for being so confused :-) Let me know where I went wrong :-)

    Cheers

    Mark.

    LEternity’s picture

    I think my solution is too complicated to implement. However, I'd still like to see how this can be done (see example in png above (#2)) or another solution that gets rid of the empty field problem.

    LEternity’s picture

    Status: Needs review » Needs work
    vannus’s picture

    dont konw if im unique (or misunderstanding the problem), but i can just click on the fields label, and itll let me enter data into an empty field...
    works for text fields when viewing the node. not tried anything else yet.
    version 6.x-2.0

    LEternity’s picture

    I can do the same thing. However, you'll get a problem when you have both editable and non-editable fields on one page. Some users will click on labels of non-editable fields expecting something to happen.

    There's no way of distinguishing labels of editable vs. non-editable fields in CSS either.

    grahamshepherd’s picture

    vannus’s picture

    I can do the same thing. However, you'll get a problem when you have both editable and non-editable fields on one page. Some users will click on labels of non-editable fields expecting something to happen.

    the 'Editable (AJAX)' option will make it clear, but i wouldnt consider it a pretty solution.
    edit: and theres also #699954: Disable Hiding of Click to Edit, once again, not that pretty.

    as for css, a 'parent' selector would be nice :)
    perhaps its possible for css to show 'empty' for empty fields? similar to Views...

    LEternity’s picture

    I think the CSS parent selector solution would be the best solution since everybody can style whatever they want then...

    murz’s picture

    Patch editablefields-703988.patch helps me, second patch (editablefields-703988-2.patch) didn't work for me. Will be good to see this in core.

    Vote_Sizing_Steve’s picture

    Here's my quick-and-dirty work-around:

    div.view-Workflow td.views-field-field-note-value div.editablefields_clicktoedit_message{
      display: block !important; }

    ... with "Workflow" and "note" (and "td") substitutable for your view's information.

    andreiashu’s picture

    Version: 6.x-2.0 » 6.x-3.x-dev
    Assigned: Unassigned » andreiashu
    Priority: Normal » Major
    Status: Needs work » Needs review

    This should be fixed in the latest 6.x-3.x-dev snapshot (it should appear within the next 12 hours on the project page).
    Can anyone please confirm and I can then backport that to the stable version.

    Thanks,
    Andrei

    andreiashu’s picture

    Status: Needs review » Fixed

    I'm marking this as fixed. Please feel free to re-open if you still experience the problem.

    Status: Fixed » Closed (fixed)
    Issue tags: -editablefields, -disappear, -empty fields, -box, -edit button

    Automatically closed -- issue fixed for 2 weeks with no activity.