Captionator module dies when submitting captions (ORM_Validation_Exception [ Database Error ]:)

veletron

Joined: 2007-07-16
Posts: 31
Posted: Sun, 2013-04-28 21:29

Hi

I am unable to make captionator work properly in G3. Error text is below. Running G3.0.7 on Ubuntu 12.04LTS with all content imported from G2.

Any assistance greatly appreciated. If its a non-starter to make this work, then I'll have to migrate back to G2. Takes way too long to add captions without captionator!

Thanks

Nigel

ORM_Validation_Exception [ Database Error ]:
ORM Validation has failed for items model
SYSPATH/libraries/ORM_Validation_Exception.php[ 20 ]

15 * @param Validation $array
16 * @return
17 */
18 public static function handle_validation($table, Validation $array)
19 {
20 $exception = new ORM_Validation_Exception('ORM Validation has failed for :table model',array(':table'=>$table));
21 $exception->validation = $array;
22 throw $exception;
23 }
24} // End ORM_Validation_Exception
SYSPATH/libraries/ORM.php[ 755 ] » ORM_Validation_Exception_Core::handle_validation( arguments )

MODPATH/gallery/models/item.php[ 887 ] » ORM_Core->validate( arguments )

SYSPATH/libraries/ORM.php[ 778 ] » Item_Model_Core->validate()

MODPATH/gallery/libraries/MY_ORM.php[ 34 ] » ORM_Core->save()

MODPATH/gallery/libraries/ORM_MPTT.php[ 79 ] » ORM->save()

MODPATH/gallery/models/item.php[ 457 ] » ORM_MPTT_Core->save()

MODPATH/captionator/controllers/captionator.php[ 68 ] » Item_Model_Core->save()

{PHP internal call} » Captionator_Controller->save( arguments )

SYSPATH/core/Kohana.php[ 331 ] » ReflectionMethod->invokeArgs( arguments )

{PHP internal call} » Kohana_Core::instance( arguments )

SYSPATH/core/Event.php[ 208 ] » call_user_func_array( arguments )

APPPATH/Bootstrap.php[ 67 ] » Event_Core::run( arguments )

DOCROOT/index.php[ 116 ] » require( arguments )

 
veletron

Joined: 2007-07-16
Posts: 31
Posted: Sun, 2013-04-28 21:44

Found the reason myself, but it looks to be a bug. Empty photo titles cause the above issue. I don't caption all pics, only those that require it. Putting a - in place of the empty caption and resubmitting works.

Issue is fully repeatable just use captionator to delete the title of an image (NB, not the filename or internet address), and upon submitting it will die with the above error.

I see that G3, unlike G2 requires every image to have a title - I guess this is the issue, captionator needs to check title length and refuse submission if no titles present in any image.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2013-04-29 03:54

Don't know how you got a item without a title unless you removed it on the form. You are the first to report this that I know.
Anyway in modules/captionator/views/captionator_dialog.html.php add the red:
<input required type="text" name="title[<?= $child->id ?>]" value="<?= html::chars($child->title) ?>"/>

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2013-04-29 03:59

The required attribute of the <input> tag is not supported in Internet Explorer 9 and earlier versions, or in Safari.
but we have to move on....

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
veletron

Joined: 2007-07-16
Posts: 31
Posted: Wed, 2013-05-01 19:01

Hi

I got an image without a title by removing the title in captionator because I did not require a title in the image!! That wee fix sorts out the issue. Blow IE9 and Safari I am never going to use captionator on them!

Thanks for the fix.

Nigel

 
nekochan
nekochan's picture

Joined: 2005-12-22
Posts: 43
Posted: Sat, 2013-11-23 07:04

This might be the same issue I'm having but no error message is returned, I simply get a blank screen and the captions, tags and so on are not entered. I checked and no Title fields are empty however. I had thought my gallery was simply timing out since I'm overseas with spotty bandwidth but today I had a good, speedy connection with the same result. Any suggestions. BTW I'm using the latest iteration of Firefox.

[edit] Incidentally, Captionator used to work but this issue started appearing a couple months ago. I can't be sure when it stated as, like I said, I frequently struggle with time out issues.

Cheers...

Brian Grover
http://www.car-free.ca/gallery/

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2013-11-23 17:39
Quote:
I simply get a blank screen

After you submit the changes in the captionator? That is much different than a ORM error due to not having a title.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
nekochan
nekochan's picture

Joined: 2005-12-22
Posts: 43
Posted: Sat, 2013-11-23 22:23

Okay... Any idea what the blank screen might indicate?

Cheers...

Brian Grover
http://www.car-free.ca/gallery/

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2013-11-24 01:44

If there is no output at all (you will have to look at the source of the page) then it is a resource issue on the server. The servers error logs should yield a clue.
If there is some O/P then it all depends what is shown in the source of the page.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team