I'm trying to create a ticketing system with Drupal 8 core. I know Drupal 8 has quick edit module, but that doesnt seem to be working in D8 core. Below is a very basic ticket I made as it just contains:

  • ticket subject (title)
  • ticket body
  • assigned to
  • status
  • priority

When viewing a ticket or node, I want to be able to be able to ajax edit the status, priority, and assigned to fields. These are dropdown options or taxonomy reference fields. Right now one would have to click on "edit" to edit the node itself to make these changes. But how would one edit these on the same page without reloading to a new page?

I was thinking of using views and exposing the edit form for the same node, but that doesnt seem like its doable.

enter image description here

  • I know Drupal 8 has quick edit module, but that doesnt seem to be working in D8 core can you expand on this? – No Sssweat Jan 30 '17 at 2:26
  • There is no way of marking a field "quick edit". I don't see it anywhere in the field settings or the manage display page. – Patoshi パトシ Jan 30 '17 at 12:17
  • in D8 there is only 1 quick edit button for the node content. You should see it when you hover the content. If you do not see it, perhaps because you're using a template file, which disables it. – No Sssweat Jan 30 '17 at 13:01
  • I don't see any button: prntscr.com/e2ah3q --- and here's the seven theme version: prntscr.com/e2ahmq --- no quick edit button anywhere. – Patoshi パトシ Jan 30 '17 at 16:29

Another approach would be to use a form mode instead of a view mode. Put there the fields you want to make writable and add the read-only information in a form alter hook (or separate view block if you want a UI only solution).

To use the form mode you need a module like Form Mode Control or some custom code, see this good tutorial https://www.webomelette.com/render-custom-entity-form-modes-programatically-drupal-8.

While quickedit is a single purpose solution for in-place editing of web content, you can now that you have a real form do all kind of tricks to get the behavior you want, for example implement autosave: https://www.urbaninsight.com/2016/08/21/how-implement-ajax-autosave-drupal-8-forms

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.