Skip to Content Skip to Menu

🌟Discover the Joomla AI Plugin that wrote its own story! - CB Editor Assistant 1.1now for Joomla 3, 4 & 5!
✍️ 5-Day Free Trial, then 🎯 save up to 30% with our 🛍️ Intro Offer (First 50 users, ends Dec. 25th)

[#4289] image field error

11 years 2 months ago - 11 years 2 months ago #235272 by iytworldwide
[#4289] image field error was created by iytworldwide
Hi Kyle,

I have added 2 CB field Image on registration page. I was doing testing to verify the scenario where the end user provides incorrect document(image) to any or both of the image field. Now when I select an "rtf" document instead of an image for this field during user registration, I get the error alert that "the rtf is not a supported image format". This is fine but to my surprise I saw the user is already created even after the error. I drilled down the code through debug and found CB approach is to create the user first and then rollback it in case of error. but why error is not first checked before creating user ?
Last edit: 11 years 2 months ago by krileon.

Please Log in or Create an account to join the conversation.

11 years 2 months ago #235273 by iytworldwide
Replied by iytworldwide on topic image field error
commit_errors is giving the error count(see the attached debug screenshot). User created just before the above code block in cb.tables.php
Code:
if ( $bindResults && $beforeResult && $pluginTabsResult ) { $this->_cbTabs->commitTabsContents( $this, $array, $reason ); $commit_errors = $_PLUGINS->getErrorMSG( false ); if ( count( $commit_errors ) > 0 ) { $this->_error = $commit_errors; $bindResults = false; } }

Please Log in or Create an account to join the conversation.

11 years 2 months ago #235274 by iytworldwide
Replied by iytworldwide on topic image field error
Sorry, I have to put the issue in 3 reply as your forum was not excepting and it was giving post error(screenshot attached).

Also the rollback mechanism is not working as the user created is not getting cleared up. Below code in cb.tables.php has no effect.
Code:
... $this->_cbTabs->rollbackTabsContents( $this, $array, $reason ); // Normal error exit point: $_PLUGINS->trigger( 'onSaveUserError', array( &$this, $this->_error, $reason ) ); ...
Attachments:

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48609
  • Thanks: 8300
  • Karma: 1446
11 years 2 months ago - 11 years 2 months ago #235287 by krileon
Replied by krileon on topic image field error
That's how it's supposed to function. It doesn't store the image until the user is stored. It has to behave this way because it needs the User ID, which it can't know until the user is stored. The reversal is just a cleanup process of the uploaded file if it moved to the images folder.

It does validation before it moves the file though, but it looks like this pre-upload validation is missing an extension check. Will fix for next release. This validation fails the registration and as it's missing an extension check it explains why registration is completing.

forge.joomlapolis.com/issues/4289


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Last edit: 11 years 2 months ago by krileon.

Please Log in or Create an account to join the conversation.

11 years 2 months ago #235292 by iytworldwide
Replied by iytworldwide on topic image field error
This issue has been reported from our production environment and fix is required to be deployed in production area. I am not sure about the bug fixing and release process of CB.
I did not understood your point related with "pre-upload validation is missing an extension check", Do you mean with the validation check in case of incorrect file type, user will be deleted from registration ? i.e. CB registration will not create user in case it has incorrect file type related with image file type ?

Thanks
Amit Dangwal

Please Log in or Create an account to join the conversation.

11 years 2 months ago #235293 by iytworldwide
Replied by iytworldwide on topic image field error
We found this issue as we have CB autoactions configured on after user registration, which did not executed as registration was not completed but user got created.

Thanks
Amit

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum