We're leveraging FAPE to implement http://drupal.org/project/edit.

For this, we also need support for two other node "properties" or "pseudofields" besides the node's title: author and authoring date.

Attached is a patch that implements this. It's simple, tested and works fine. However, both of these properties are slightly more complex than the title field, which does not need any validation.

Note that I did also update fape_panels_pane_content_alter(), though without testing this functionality.

Comments

psynaptic’s picture

Status: Needs review » Needs work

Since I made the changes to this in #1672598: Clean up inline code documentation in PHP files I'm happy to make these changes too. Just doing the review in the interests of transparency.

+++ b/fape.moduleundefined
@@ -287,6 +297,85 @@ function fape_field_edit_node_title_form_submit($form, &$form_state) {
+  $form['#validate'][] = 'fape_field_edit_node_author_form_validate';
+  $form['#submit'][]   = 'fape_field_edit_node_author_form_submit';

The rest of the fape.module file doesn't align assignment operators. We should definitely follow suit.

+++ b/fape.moduleundefined
@@ -287,6 +297,85 @@ function fape_field_edit_node_title_form_submit($form, &$form_state) {
+// Taken from node_validate().

This needs use the correct syntax for doxygen function headers. Using a @see directive for reference to node_validate() would be nicer.

+++ b/fape.moduleundefined
@@ -287,6 +297,85 @@ function fape_field_edit_node_title_form_submit($form, &$form_state) {
+// Taken from node_submit().

Same comment about doxygen function header.

+++ b/fape.moduleundefined
@@ -287,6 +297,85 @@ function fape_field_edit_node_title_form_submit($form, &$form_state) {
+  // node_object_prepare() is necessary to calculate node->date!

I think the re-wording from my other patch improves this slightly.

+++ b/fape.moduleundefined
@@ -287,6 +297,85 @@ function fape_field_edit_node_title_form_submit($form, &$form_state) {
+    '#description' => t('Format: %time. The date format is YYYY-MM-DD and %timezone is the time zone offset from UTC. Leave blank to use the time of form submission.', array('%time' => !empty($node->date) ? date_format(date_create($node->date), 'Y-m-d H:i:s O') : format_date($node->created, 'custom', 'Y-m-d H:i:s O'), '%timezone' => !empty($node->date) ? date_format(date_create($node->date), 'O') : format_date($node->created, 'custom', 'O'))),

This line is too complex to be readable. It would be much better to assign these ternaries above the element definition.

+++ b/fape.moduleundefined
@@ -287,6 +297,85 @@ function fape_field_edit_node_title_form_submit($form, &$form_state) {
+  $form['#validate'][] = 'fape_field_edit_node_created_form_validate';
+  $form['#submit'][]   = 'fape_field_edit_node_created_form_submit';

Same comment as above about alignment of assignment operators.

+++ b/fape.moduleundefined
@@ -287,6 +297,85 @@ function fape_field_edit_node_title_form_submit($form, &$form_state) {
+// Taken from node_validate().

Same as above.

+++ b/fape.moduleundefined
@@ -287,6 +297,85 @@ function fape_field_edit_node_title_form_submit($form, &$form_state) {
+// Taken from node_submit().

Same as above.

+++ b/fape.moduleundefined
@@ -373,22 +462,21 @@ function fape_panels_pane_content_alter($content, $pane, $args, $context) {
+  // We also support the node title, author and created fields specifically.

I think there should be a command before "and".

psynaptic’s picture

Status: Needs work » Needs review
StatusFileSize
new6.22 KB

I have created a patch with all the changes mentioned above.

wim leers’s picture

Bump. What can we do to move this forward?

awebb’s picture

I'll try and take a look at this tonight or tomorrow.

damienmckenna’s picture

Issue summary: View changes
Status: Needs review » Needs work

Needs to be rerolled.

damienmckenna’s picture

Status: Needs work » Needs review
StatusFileSize
new5.79 KB

Rerolled.

damienmckenna’s picture

Status: Needs review » Needs work

Lets get this tested.

damienmckenna’s picture

Status: Needs work » Needs review

  • Commit edddab5 on 7.x-1.x by DamienMcKenna:
    Issue #1650442 by Wim Leers, psynaptic, DamienMcKenna: Support for the...
damienmckenna’s picture

Status: Needs review » Fixed

Committed. Thank you both!

damienmckenna’s picture

Status: Fixed » Closed (fixed)

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