-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG]: Attach Control not working in web-form #5
Comments
@mohsinalimat Thanks a lot buddy for reporting this.. I knew that there is an issue with the web form but I didn't find a way to fix it.. Can you please check the console for any error.. I'm very thankful for your help.. Best regards.. |
in inspect element html we put accept="image/*" then only images option comes in file browser. |
@mohsinalimat That's weird.. Anyway, I have updated the plugin, hopefully it will fix this issue.. Best regards.. |
Still not working in web-from in version-14. |
@mohsinalimat I couldn't find a solution for this problem.. I think that the problem isn't from the plugin, but from the Check this #4 for more info.. Best regards.. |
@mohsinalimat Hey buddy.. I think that I have found a solution for the web form. Can you please update the plugin, move the config from the To show gratitude for your contribution to this plugin, I have added your name in the README file.. Best regards.. |
Still same error. |
Please share a demo video for web-form restrictions. |
@mohsinalimat Sorry buddy, I can't test it currently.. The issue was that in So, I added a custom field to hold the plugin options in order to bypass this action of Have you tried it after putting the options in the custom field? If yes and it still doesn't work, please let me know.. Best regards.. |
I have child table in web-form. And in child table assign the image property. |
Is there a field property called If yes, did you put the plugin options inside it instead of the if yes, then did it work for you in web form or not? |
@mohsinalimat Hey buddy.. I just wanted to remind you about the questions I wrote in the above comment.. I'm still waiting for your reply.. Best regards.. |
I can not find any |
@mohsinalimat There should be a field for the plugin options.. What version you are using? The field exists in the Beta-8 version... |
version-14 & version-13
Yes, Beta-8 |
@mohsinalimat I believe that you understood me wrong.. The plugin field will only appear if the field type is So, when you edit your attach field you will see it and not when editing the child table... If you edit your |
@mohsinalimat The plugin setup code might not have created the custom field.. Can you please do the following..
After creating the custom field, you will be able to see it when editing an Attach or Attach Image field.. If you can't find the document DocField, please let me know.. Best regards.. |
It should be working.. Anyway, I have made a small change to the plugin.. Please update and then when you open the web form, open the browser console and you will see the current options of the plugin. Check if the options from the console matches the options from the Better Attach Options field.. Also you will find in the console the uploader options that is being used when you click on the attach button and the file browser options when you click on the file browser button.. All the 3 options that you will find in the console should match with the options from the Better Attach Options field.. Thanks a lot buddy for your help.. |
Update the custom app but still same issue. |
@mohsinalimat Can you please post a screenshot of the web browser console when using the web form.. |
@mohsinalimat I realized that the plugin doesn't override the default attach controls in web forms since it doesn't get loaded at all.. Injecting custom JavaScript and CSS files to web forms cannot be done unless specified in the hooks and for specific standard web forms only.. Because of that, I have made the plugin intercept the web form load and manually inject both JavaScript and CSS but I'm not sure that it will work since I don't know when the code will be executed, at the beginning of the web form load or at the end (which is the right time).. So please update the plugin and check if it works automatically in web forms or not.. If it doesn't work, then the please try the following..
For v14
For v13
For v12
|
Still facing same issue. |
@mohsinalimat Did you update the plugin? If you did then please check frappe error log doctype and see if there is an entry from the plugin.. Have you tried the second method which is adding the js code? |
@mohsinalimat Thanks a lot buddy for your help.. Just to clarify things, you have an attach field in a child table and because of the attach field, you can't edit a row or add a new one in that child table. Am I right? What about if the attach field is not in a child table, does it work or not? |
Not checked. |
Yes. And it's sometimes this happened. |
@mohsinalimat I suspect that it is because of the dialog that is supposed to display the file when the filename is clicked.. Is the field type Attach or Attach Image? Attach Image field doesn't have a dialog so can you please try the child table with Attach Image field.. And can you please try both Attach and Attach Image fields outside child table.. v2 will be dedicated to you bro for your enormous help 😁 |
It's Attach field type. |
@mohsinalimat I have changed a bit for v14 desk and web form controls in terms of the filename click. I have put some console logs for the click event and removed the previous logs.. So please update and check the console after you click on the attached filename, edit button and add row button.. If you find any log in the console, please post a screenshot.. Best regards.. |
ScreenRecorderProject1.mp4 |
@mohsinalimat I have updated the plugin.. I have disabled the uploaded files list and preview dialog that appears after clicking the file name, only if the field is placed inside a child table.. I'm trying to find out if the problem is from the dialog or not.. There should be a console log stating that the field is inside a child table but if it doesn't appear in console it means that the child table check code isn't working.. Please give it a try and then let me know if it is still working in web form and if the bug is fixed in desk.. Best regards.. |
@mohsinalimat Hey buddy.. I just wanted to check if you have tried the last update or not. Best regards.. |
I think all is good. And in form edit view there is bug in frappe framework. |
@mohsinalimat Thanks a lot bro.. So the problem was with the dialog of uploaded files.. I will create a custom dialog that is not bound to frappe dialogs, then I will update the plugin and let you know.. Can you please tell me about the frappe bug you found so I can check if I can help them fixing it.. Best regards.. |
In Attach field type in child table issue. |
@mohsinalimat I have updated the plugin with custom dialog for uploaded files.. Please give it a try..
You mean the edit dialog is still not opening? |
@mohsinalimat Bro, I just want to remind you about trying out the latest update.. Have you tried it?
You mean the edit dialog is still not opening? |
Yes. Not opening |
@mohsinalimat Is the edit dialog not opening using the latest update? If yes, then I need to create a different way to display the list of uploaded files in child table.. Thanks a lot bro.. |
Yes, not opening in form view in child table. |
@mohsinalimat Brother, I have updated the plugin.. Now the child table dialog should open and everything should work.. Please give it a try and let me know if you find any bug or problem.. Please also try it with multiple files disabled, using Attach Image and also when editing an entry with already uploaded files, only if you have time.. Best regards.. |
@mohsinalimat I just want to check if everything is working or there are any issues.. Best regards.. |
Still not opening in form view in child table. |
That's weird bro. I have made the dialog gets created on demand and gets destroyed when closed so it doesn't block the child table dialog. Just like dialog of frappe File Uploader.. Do you think that I should get rid of the dialog and find another way to list and preview the uploaded files? Should I do that for child table only or for form also? Thanks a lot for your help bro.. Best regards.. |
@mohsinalimat Hey bro.. I have removed the dialog from the plugin and replaced it with a list that is displayed under the field.. I have removed the dialog from desk and web form.. So please whenever you are free, update the plugin and give it a try.. I hope that there will be no bugs this time.. Best regards.. |
@mohsinalimat Hey bro.. I just want to check if everything is working well or there are still some bugs.. Best regards.. |
I have update the plugin but still I am facing the issue. |
also in frappe standard webform i am not able to attach files. it is throwing exception 404 error |
@kid1194 please help me with this. |
@NirajRegmi Hey bro.. First, I would like to thank you for reporting problems and for your patience.. I have made a lot of changes hoping that it will work without any problem.. The custom field is no longer needed since the app now has a registered hook for website context where it checks if the page displayed is a web form or not.. For web forms, the app will get all the attach field options, build the js library if not already built and inject the field options to js.. So please give it another try and let me know if you face any problem.. A million thanks to you bro, and I hope that putting a badge with your name on it in the README file will show some of my appreciation for you.. Best regards.. |
When I assign options {"allowed_file_types": ["image/*"]} in Attach Field Type then I will not work on web-form
in version-13 and version-14 as well.
The text was updated successfully, but these errors were encountered: