Problem/Motivation

Editable Views comes with a single default Display - Table (or "Horizontally Displayed"). Table display works OK for many applications, but when an entity has text areas, or many fields, the display can become unwieldy. Also, editable views is a great way to provide case by case entity edit screens without having to emply hook_forms, but it would be nice to have the "Unformatted" style which more closely resembles the default Drupal edit screens (or "Vertically Displayed".

Image 1:Horizontally Displayed Fields with Standard "Editable Table" Views Display.
Editable Table Views Display
Image 2:Vertically Displayed Fields with New "Editable Unformatted" Views Display.
Editable Unformatted Views Display

Proposed resolution

Create a Views Display plugin to add unformatted display. The attached patch does this by simply copying code wholesale from the table views, but extending the class "views_plugin_style_default" instead of "views_plugin_style_table". The plugin definition mirrors the Views plugin style "default".

Remaining tasks

  • Preliminary testing by patch author
  • Wider testing by others
  • Review by module maintainer

User interface changes

Adds the option "Editable Unformatted" to Views Display selector.

API changes

none.

Data model changes

none.

Comments

robertwb created an issue. See original summary.

robertwb’s picture

robertwb’s picture

Status: Active » Needs review
robertwb’s picture

Updated patch to be refcognize a column level option to "suppress_value". This is therefore compatible with proposed patch to suppress value (https://www.drupal.org/node/1980238). This modification will NOT REQUIRE #1980238, but allows for it or some other patch that sets the config option "suppress_value".

Status: Needs review » Needs work

The last submitted patch, 4: editableviews-style-unformatted-2579113-03.patch, failed testing.

robertwb’s picture

Status: Needs work » Needs review
StatusFileSize
new13.94 KB

Updated patch from #4 to add file back in (#4 accidentally used "git diff" instead of "git diff --staged"). Also, patch in #4 was erroneously named -03.

robertwb’s picture

Previous patches had included the new plugin files, but were not diffed properly to include code as well. Attached patch uses "git diff HEAD" to produce a patch that contains both file and code updates.

robertwb’s picture

Issue summary: View changes
StatusFileSize
new12.12 KB
new13.31 KB
robertwb’s picture

Issue summary: View changes
robertwb’s picture

Issue summary: View changes
robertwb’s picture

Issue summary: View changes

Graphics editing.

robertwb’s picture

Issue summary: View changes
robertwb’s picture

Issue summary: View changes
robertwb’s picture

Issue summary: View changes
robertwb’s picture

Issue summary: View changes
robertwb’s picture

Issue summary: View changes
robertwb’s picture

Issue summary: View changes
robertwb’s picture

Issue summary: View changes
robertwb’s picture

Issue summary: View changes
nwom’s picture

Thanks a lot for the patch! It works perfectly. The only thing I noticed was there was some commented out dsm lines, and the following was shown when applying it via drush_iq:

Switching to branch drush-iq-add-editable-unformatted-views-2579113-1                                                                                                                              [ok]
Branch drush-iq-add-editable-unformatted-views-2579113-1 set up to track remote branch 7.x-1.x from origin.
Switched to a new branch 'drush-iq-add-editable-unformatted-views-2579113-1'
Checking patch editableviews.info...
Checking patch editableviews.views.inc...
Checking patch editableviews_plugin_style_edit_unformatted.inc...
/var/aegir/platforms/panopoly-7.x-1.30/sites/{SITE}/modules/editableviews/editableviews-style-unformatted-2579113-07.patch:394: new blank line at EOF.
+
Applied patch editableviews.info cleanly.
Applied patch editableviews.views.inc cleanly.
Applied patch editableviews_plugin_style_edit_unformatted.inc cleanly.
warning: 1 line adds whitespace errors.
No syntax errors detected in editableviews.views.inc
No syntax errors detected in editableviews_plugin_style_edit_unformatted.inc
robertwb’s picture

Thanks @NWOM - bad habit! - I will clean that up and re-apply.

robertwb’s picture

Attached is a new patch with devel message statements removed. Thanks again @NWOM for the review.

robertwb’s picture

nwom’s picture

Awesome. Just noticed something else. The .info file is referencing the following non-existent file:

+files[] = handlers/editableviews_handler_field_entity_field_edit.inc

petednz’s picture

thanks for the work to try and deliver this which looks like a good addition. should I be testing the patch in #23 or is there another one just waiting this teeny nudge?

robertwb’s picture

Hey @petednz - thanks for bringing this up -- just removed the extra files line mentioned in #24 - patch attached.

mrpeanut’s picture

Patch from #26 applies and works great!

robertwb’s picture

Can we get an RTBC here?

petednz’s picture

@robertwb - thanks for progressing this, and to MrPeanut for testing/confirming. I will see if we can get it tested too in next few days.

robertwb’s picture

Thanks @petednz!

petednz’s picture

Concur that when applied and cron cleared i see a new option in Table Settings for Editable Unformatted, and that this setting render the fields vertically.

many thanks

I assume the issues i have with eg the label showing twice if i choose 'Use handler label for form element" is unrelated to this patch.

petednz’s picture

Status: Needs review » Reviewed & tested by the community
nwom’s picture

Rules don't seem to trigger when content is updated. Anyone else having this issue in combination with this patch?

Edit: Nevermind, the rule is triggering as expected. After enabling debugging on rules I was able to verify this. Please disregard this comment.

hochh1707’s picture

Just found this patch and implemented it on a site I'm building. Very useful. Thanks!

nwom’s picture

#26 still applies cleanly to the newest dev.

khalor’s picture

Yep, can also confirm #26 still works against current dev

assembledbits’s picture

#26 works, but I must be missing something... this allows Anonymous users to edit fields. There are no permissions?

robertwb’s picture

@assembledbits - I don't think that this particular mod affected permissions as it is only a display plugin, and is a near carbon copy of the original (but if I'm wrong I will fix it). That said, it should use honor all Views permission options as well as any others that are built into the Ctools field form components (if there are any?). FWIW - Views by default have no permissions, but it is a best practice to always explicitly set permissions on Views.

sethpkendall’s picture

After patching the module I see the "Editable Unformatted" option in the format choices on my views but selecting it and clicking "Apply" does nothing. The format remains on the previous selection. No PHP errors, no nothing. Any suggestions?

robertwb’s picture

@sethpkendall - clear caches? Haven't seen this effect otherwise.