Jump to content

Images won't save if field is within a Fieldset in Tab


FireWire
 Share

Recommended Posts

Hey everyone,

I have an images field that is located within a Fieldset in Tab. When I add images it appears to upload them but when I publish the page they disappear. Here are some more details.

  • The images are actually added (uploaded) to the page's asset directory but don't show up in the admin and aren't accessible from the API.
  • Moving the field to the Content tab does not show the previously uploaded images, but it does allow you to add/upload images and they appear correctly.
  • If you've entered images on the Content tab and move the field back to the other Fieldset in Tab, the images entered on the Content tab remain and are accessible via the API
  • I've set and unset options for size requirements, for it's Formatted output value, etc.
  • I have deleted the field, created a new one, and added it back to the tab- same issue.

Basically tried everything I can think of and haven't run into this before.

*Update* - Just found that the field doesn't work inside a regular Fieldset either. I'm out of ideas.

Running PW v3.0.77

Link to comment
Share on other sites

20 hours ago, skylundy said:

I'm out of ideas.

Hi, Do you happen to have any non-core modules dealing with images? I'm asking this because I do not have any, and image fields in FieldsetTab work properly. I'm on ProcessWire 3.0.76 though.

  • Like 1
Link to comment
Share on other sites

Just now, szabesz said:

Hi, Do you happen to have any non-core modules dealing with images? I'm asking this because I do not have any, and image fields in FieldsetTab work properly. I'm on ProcessWire 3.0.76 though.

I don't believe so. I also downgraded to 3.0.76 just in case updating the core created an issue. Here is a list of my modules:

  • FieldtypePhone
  • FieldtapeRepeaterMatrix
  • FieldtypeSelect
  • FieldtypeTable
  • FieldtyupeTextareas
  • InputfieldCKEditor
  • MarkupSEO
  • MarkupSitemapXML
  • PageEditSoftLock
  • PageListShowPageId
  • PasswordForceChange
  • ProcessDatabaseBackups
  • ProcessPageDelete
  • ProcessRedirects
  • ProcessWireUpgrade
  • ProDrafts
  • TemplateNotes
  • TextformatterAutoLinks
  • VersionControl

 

Link to comment
Share on other sites

Hm, I cannot see any suspicious modules among those. Note that I do not have ProDrafts which is made by Ryan so probably not causing any troubles but this one is doing some black magic behind the scenes so one never knows... sure I'm just wild guessing here.

Have you checked the related database table? How does it change? It has a pages_id column which indicates the page in question of course. Does the table seem to be ok?

Edited by szabesz
typo
Link to comment
Share on other sites

1 hour ago, szabesz said:

Hm, I cannot see any suspicious modules among those. Note that I do not have ProDrafts which is made by Ryan so probably not causing any troubles but this one is doing some black magic behind the scenes so one never knows... sure I'm just wild guessing here.

Have you checked the related database table? How does it change? It has a pages_id column which indicates the page in question of course. Does the table seem to be ok?

I'm checking and don't see anything out of the ordinary with respect to the other data around it. Then again I'm not 100% sure what to look for.

Link to comment
Share on other sites

5 minutes ago, adrian said:

I would start looking for JS errors in the console and in particular for the ajax called image upload file on the Network tab. Make sure you disable cache on the console in Chrome.

Can't find anything out of the ordinary and the file shows up in the page assets file.59d4091360b17_ScreenShot2017-10-03at3_01_58PM.thumb.png.35c6efe1f0170547bcf1172dbb20368b.png

Link to comment
Share on other sites

Would be interested to know is this you only ProcessWire installation?  If not, do you have the same issues with your other installs or a basic install of ProcessWire (with no 3rd party modules)?  Also knowing the PHP and MySQL version would also be beneficial.   

Link to comment
Share on other sites

Just now, cstevensjr said:

Would be interested to know is this you only ProcessWire installation?  If not, do you have the same issues with your other installs or a basic install of ProcessWire (with no 3rd party modules)?  Also knowing the PHP and MySQL version would also be beneficial.   

I've done many PW sites never an issue really an odd bug. Running a Docker instance with PHP7 & MariaDB 10.

Link to comment
Share on other sites

2 hours ago, skylundy said:

Can't find anything out of the ordinary and the file shows up in the page assets file.59d4091360b17_ScreenShot2017-10-03at3_01_58PM.thumb.png.35c6efe1f0170547bcf1172dbb20368b.png

This is the entry I'd be looking at (screenshot below). Make sure you have debug mode on, and having Tracy installed may also help because it should report on errors in AJAX requests, although it may not be a PHP error, but rather an ill-formed JSON response, which is why you should also check out the response tab of that file in the screenshot.

59d42a8d835a8_ScreenShot2017-10-03at5_25_14PM.thumb.png.bf8ea94ddff9ba3c89b5086e83c501bb.png

  • Like 3
Link to comment
Share on other sites

23 minutes ago, Robin S said:

Based on that thumbnail URL I'd be looking closely at ProDrafts. You could try a clean installation with only ProDrafts added and see if the fieldset issue is reproducible.

Thanks. Will do. I wasn't too far into building out the cms so I started over. It does seem like ProDrafts would be the most likely culprit.

Link to comment
Share on other sites

Final Update:

I reinstalled 3.0.77 and went module by module. The issue is caused by using the new Fieldset (Page) module. I was really looking forward to using this new feature. Unfortunately enabling that module has an effect on image fields within tabs. I was using a Fieldset (Page) field in the same tab however moving it outside of that tab group did not solve the issue. Something that still has to be worked on I guess.

Can also confirm that by uninstalling this module, the issue disappears.

Bummed. This Fieldset (Page) module looks fantastic.

Thanks everyone for their help!

Edited by skylundy
Found the cause of the issue.
  • Like 1
Link to comment
Share on other sites

3 minutes ago, Robin S said:

No problems here uploading images inside a FieldsetPage, whether the FieldsetPage is inside a FieldsetTab or not.

I'm out of ideas... installing/uninstalling that module made the difference for me. Is there anything else that could be doing it? A combination of things?

Link to comment
Share on other sites

30 minutes ago, Robin S said:

No problems here uploading images inside a FieldsetPage, whether the FieldsetPage is inside a FieldsetTab or not.

My issue is that if a FieldsetPage is within the same tab as an image field, the image field won't upload. The image field is outside of the FieldsetPage.

If my image field is inside a FieldsetPage, it works fine like yours does.

  • Like 1
Link to comment
Share on other sites

11 minutes ago, Robin S said:

Still works for me...

 

You're testing this with no other non-default modules installed apart from FieldsetPage?

I did do that when I reinstalled to the latest dev. The only non-default module I have installed besides that is DB Backups so that I can jump around and test without losing info or work.

I am trying again now.

Link to comment
Share on other sites

Just now, skylundy said:

The only non-default module I have installed besides that is DB Backups so that I can jump around and test without losing info or work.

When debugging something like this (for a possible bug report) it's best to do it on a new PW installation on your localhost - you don't want to be messing with your actual project installation. It only takes a few minutes to do a fresh install for testing purposes.

  • Like 2
Link to comment
Share on other sites

2 minutes ago, skylundy said:

Alright. I re-stripped everything and it works. I'm going to go by one by one and test each module until I find the culprit. Will post if/when I can nail that down.

The other useful tool here is the Module Disabler panel in Tracy: https://processwire.com/blog/posts/introducing-tracy-debugger/#module-disabler-panel

Alternatively if you decide to uninstall modules, make sure you have ModuleSettingsImportExport installed so that it takes care of backing up module settings so you can restore when you reinstall a module.

Sorry, lots of self-promotion there :)

  • Like 1
Link to comment
Share on other sites

4 minutes ago, Robin S said:

When debugging something like this (for a possible bug report) it's best to do it on a new PW installation on your localhost - you don't want to be messing with your actual project installation. It only takes a few minutes to do a fresh install for testing purposes.

Yeah I am working on localhost with a fresh install but may have missed testing. This was more on me for not being more thorough. The DB Backups is a go-to as it makes keeping a backup of the DB in the file system fast and reliable while keeping it inside the Git repo I'm working on. Helps coordinate the entire state of the code & CMS in one commit.

@adrian I will look into those- good suggestion!

Link to comment
Share on other sites

The culprit is ProDrafts. As soon as that was installed the image field started malfunctioning if it is outside of a FieldsetPage.

So the FieldsetPage in PW version v3.0.77 and the current latest ProDrafts module v0.0.6 conflict.

  • Like 2
Link to comment
Share on other sites

1 minute ago, skylundy said:

The culprit is ProDrafts. As soon as that was installed the image field started malfunctioning if it is outside of a FieldsetPage.

So the FieldsetPage in PW version v3.0.77 and the current latest ProDrafts module v0.0.6 conflict.

Thanks for tracking that down. Would you mind posting a new message on the Pro Drafts module board please ?

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...