Project

General

Profile

Actions

Support #16545

open

"Bug in customizr? Gravity form submitted image"

Added by Marilyn Weber 2 months ago. Updated about 1 month ago.

Status:
New
Priority name:
Normal
Assignee:
-
Category name:
-
Target version:
-
Start date:
2022-07-29
Due date:
% Done:

0%

Estimated time:

Description

Syelle Graves reports:

We have a hopefully-simple question about a Gravity form that uses the post creation option on this site https://weauthors.commons.gc.cuny.edu/category/spanish/

The problem is that even though we have the submitted image set to be the featured image of the post draft, the image never appears in the post itself: https://weauthors.commons.gc.cuny.edu/wp-admin/admin.php?page=gf_edit_forms&id=1 (https://weauthors.commons.gc.cuny.edu/wp-admin/admin.php?page=gf_edit_forms&id=1)

I have ignored this for some time, because on the BMCC OL, where I also work, we have observed this to be a bug in this same theme that we are using here on the Commons site (Customizr).

However, perhaps your team has a solve? Is there any way to get the image to show in the post tile without us adding it manually? We are doing a large-scale project of CUNY student writing, and it would be a huge benefit to our instructors who have to publish hundreds of student submissions by hand as they come in.

Many thanks!

~


Files

2022-08-03_112745.png (23.6 KB) 2022-08-03_112745.png Raymond Hoh, 2022-08-03 02:28 PM
gf-settings.gif (932 KB) gf-settings.gif Raymond Hoh, 2022-08-05 04:17 PM
gravity-form-file-upload-settings.png (61.6 KB) gravity-form-file-upload-settings.png Raymond Hoh, 2022-08-22 07:01 PM
Actions #1

Updated by Marilyn Weber about 2 months ago

How should I reply to Syelle? Or would you rather add her to this ticket? Thanks!

Actions #2

Updated by Boone Gorges about 2 months ago

Hello - It's Monday morning and I've just seen this ticket from Friday. Please let Syelle know that our team will have a look in the upcoming days.

Actions #3

Updated by Marilyn Weber about 2 months ago

Very sorry - didn't mean to be pushy! It's been an intense weekend. Can we add Syelle as a watcher?

Again, true apologies. I know how annoying that is.

Actions #4

Updated by Raymond Hoh about 2 months ago

From reading the ticket, it would appear to be a Gravity Forms limitation.

A Featured Image requires using attachments and a Gravity Form Upload isn't stored as a WordPress attachment. You might be able to workaround this with a GF plugin like https://wordpress.org/plugins/gf-uploads-as-attachments/, then you would have to set the _thumbnail_id custom field in your GF form to the new WordPress attachment post ID. Would need some testing though.

Update - Looks like that plugin is only for GF email notifications, so that will not work.

Actions #5

Updated by Raymond Hoh about 2 months ago

Sorry, looks like I'm wrong. The upload is using the "Post Image" field, but according to the GF documentation:

Note: This field cannot be used with the Advanced Post Creation Add-On. If utilizing that plugin for post creation, use a File Upload field instead.

See https://docs.gravityforms.com/post-image/. The Advanced Post Creation Add-On is enabled on the site, so it looks like you cannot use the "Post Image" field with your Gravity Form to accomplish the Featured Image functionality.

Actions #6

Updated by Raymond Hoh about 2 months ago

Okay, got it working!

Needed to switch the "Post Image" field to the "File Upload" field. Then, you are able to select to save the file upload to the Media Library and the "Featured Image" field can be mapped to our custom "File Upload" field.

Should be working now.

Actions #7

Updated by Marilyn Weber about 2 months ago

Two replies from Syelle:

1) OH. MY GOSH. Thank you so, so much, Dev Team! It's working perfectly so far. I'll let my team know.

Would this work on other WP multi-sites?

2) Just a follow up! Could you ask them how they did the second two steps, “select to save the file upload to the Media Library” and “the Featured Image field can be mapped to our custom File Upload field?”

I don’t see those two settings, and it would be great to be able to set this up on another gravity form!

Actions #8

Updated by Marilyn Weber about 2 months ago

Another reply/question from Syelle:

I hope it's OK if we ask just one more question of the dev team.

I activated the Default Featured Image plugin so that when students don't submit an image with their writing, the post at least gets the default image that we set.

However, we have students submitting in multiple languages, and we would love to have the post choose a default featured image that we designate that matches the language they are writing in. This would save our faculty members a lot of work adding a featured image when students don't submit one in the form (now that the form automatically includes the student’s submitted image!). Could we ask Ray if there is any way to set this up?

Actions #9

Updated by Raymond Hoh about 2 months ago

Would this work on other WP multi-sites?

Yes, it should. It's just configuring the same settings for the Gravity Form.

I don’t see those two settings, and it would be great to be able to set this up on another gravity form!

I've attached an image of the two settings. This is available on the GF form's "Settings > Post Creation > Post Creation Feed 1" page.

However, we have students submitting in multiple languages, and we would love to have the post choose a default featured image that we designate that matches the language they are writing in.

This wouldn't be possible without custom code or a plugin like this one: https://wordpress.org/plugins/category-featured-image/. Untested. Maybe Syelle can try this on the BMCC site and if it works well we can consider including it on the Commons.

Actions #10

Updated by Marilyn Weber about 2 months ago

Ray or Boone -

Can you add Syelle to this ticket? Thanks!

Actions #11

Updated by Boone Gorges about 2 months ago

Sure thing. I've added her.

Actions #12

Updated by Marilyn Weber about 2 months ago

Great, I've let her know. Here's the latest:

I had to deactivate the Default Featured Image plugin, because form submissions came through as published instead of draft form, and, the default image overrode the submitted image, for some reason.

So just any info about how we could get an image to be set as featured in the post by category when the person does not submit an image, and then any additional details about how Ray set-up the image magic the way he did, because I don't see those settings in the form.

Actions #13

Updated by Raymond Hoh about 2 months ago

So just any info about how we could get an image to be set as featured in the post by category when the person does not submit an image

As I mentioned above, this would most likely have to be custom-coded.

and then any additional details about how Ray set-up the image magic the way he did, because I don't see those settings in the form.

See https://redmine.gc.cuny.edu/attachments/22918 for the specific fields.

This is available on the GF form's "Settings > Post Creation > Post Creation Feed 1" page.

I've also just captured a GIF of the process:

Actions #14

Updated by Syelle Graves about 2 months ago

I don’t see those two settings, and it would be great to be able to set this up on another gravity form!

I've attached an image of the two settings. This is available on the GF form's "Settings > Post Creation > Post Creation Feed 1" page.

Thank you! Did you type "image" in both fields in your screenshot?

However, we have students submitting in multiple languages, and we would love to have the post choose a default featured image that we designate that matches the language they are writing in.

This wouldn't be possible without custom code or a plugin like this one: https://wordpress.org/plugins/category-featured-image/. Untested. Maybe Syelle can try this on the BMCC site and if it works well we can consider including it on the Commons.

Thank you for confirming that this wouldn't be possible otherwise! At the BMCC OL, we are trying to avoid adding plugins, but I will run this by the team, as I do think it might interest some of our faculty there. If we add it, I'll let you know. If you add it, let me know!

Actions #15

Updated by Syelle Graves about 2 months ago

Boone Gorges wrote in #note-11:

Sure thing. I've added her.

Thank you, Boone & Marilyn.

Actions #16

Updated by Syelle Graves about 2 months ago

Raymond Hoh wrote in #note-13:

So just any info about how we could get an image to be set as featured in the post by category when the person does not submit an image

As I mentioned above, this would most likely have to be custom-coded.

I replied to your helpful suggestion about the plugin idea. Thanks again.

and then any additional details about how Ray set-up the image magic the way he did, because I don't see those settings in the form.

See https://redmine.gc.cuny.edu/attachments/22918 for the specific fields.

This is available on the GF form's "Settings > Post Creation > Post Creation Feed 1" page.

I've also just captured a GIF of the process:

Thank you, Ray--I'm only just now getting caught up on these replies. Thank you for the gif! I can't quite see what you do with the word "image" in those two fields, but I found the path thanks to your last reply, above.

Actions #17

Updated by Syelle Graves about 2 months ago

Marilyn Weber wrote in #note-12:

Great, I've let her know. Here's the latest:

I had to deactivate the Default Featured Image plugin, because form submissions came through as published instead of draft form, and, the default image overrode the submitted image, for some reason.

Ray, if you are available for a bit more work on this, (and this is separate from the wish for a default image by post category, which you've confirmed is not possible without a new plugin or customized CSS)...

Do you have any idea why activating the Default Featured Image plugin caused the two issues above? Is that some kind of plugin interaction, or is it something that another advanced setting could resolve? My team asked me to ask you, because it would save our assistant many hours of having to go into each student post that has no submitted image and add a default image by hand. :) We could use one image for all categories, if the DFI plugin didn't cause those issues.

Thank you!

Actions #18

Updated by Raymond Hoh about 1 month ago

Thank you for the gif! I can't quite see what you do with the word "image" in those two fields, but I found the path thanks to your last reply, above.

Hi Syelle,

The word "Image" comes from the "File Upload" field that is configured for the Gravity Form, which is named "Image":

The GIF from here ensures that our "Image" File Upload field will be used for the Media Gallery and also for the Featured Image.

Ray, if you are available for a bit more work on this, (and this is separate from the wish for a default image by post category, which you've confirmed is not possible without a new plugin or customized CSS)...

I have a solution with custom CSS!

See https://weauthors.commons.gc.cuny.edu/category/japanese/ for an example and the CSS I've used on the admin page here: https://weauthors.commons.gc.cuny.edu/wp-admin/themes.php?page=simple-css.

This is the CSS I'm using:

article.category-japanese div.has-thumb img[src="https://weauthors.commons.gc.cuny.edu/wp-content/themes/customizr/assets/front/img/thumb-standard-empty.png"] {
    content:url("https://weauthors.commons.gc.cuny.edu/files/2022/07/Japanese_Edited-300x198.png");
}

To add a new default featured image for the Spanish category, you'll need to copy and paste that snippet and replace "category-japanese" with "category-spanish" and you'll need to replace the "content:url" line to the URL of your Spanish featured image.

Hope that helps! Also feel free to delete the test post I made to test the CSS.

Actions

Also available in: Atom PDF