Jump to content


[SOLVED] Set Data Type doesn't work properly - Deletion on Update


  • Please log in to reply
13 replies to this topic

#1 Ruedische

Ruedische

    Member

  • Members
  • PipPip
  • 12 posts

Posted 18 April 2012 - 05:45 PM

In my database table is a field with the MySQL-Type "Set". When I update a record, this field will always be deleted. Is there a quick fix? BTW: Enum-types work well.

#2 web-johnny

web-johnny

    grocery CRUD Author

  • Administrators
  • 1,099 posts
  • LocationLondon

Posted 18 April 2012 - 07:08 PM

I will look at it and I will inform you as soon as possible. What browser do you use?
Posted Image

#3 Ruedische

Ruedische

    Member

  • Members
  • PipPip
  • 12 posts

Posted 18 April 2012 - 07:22 PM

I'm using Firefox 11 on Win XP. Inserting data with multiple select SET-field works fine. But while editing a record, the selected options are always getting cleared - they are indicated in the form (which can be seen in the HTML source code), but after saving they are gone.
<div class='form-input-box' id="quartal_input_box">
	 <select multiple onchange="var v = ''; for (var i in this.options) if (this.options[i].selected) v += (v == '' ? '' : ',') + this.options[i].value; this.nextSibling.value = v;"><option value='1'  >1</option><option value='2' selected='selected' >2</option><option value='3'  >3</option><option value='4' selected='selected' >4</option></select><input type='hidden' name='quartal' />    </div>
    <div class='clear'></div>


#4 web-johnny

web-johnny

    grocery CRUD Author

  • Administrators
  • 1,099 posts
  • LocationLondon

Posted 18 April 2012 - 07:38 PM

OK I wil look at it and l will fix that as it is really important bug and I will have a fix for that. Probably I will have a quick express release for that at version 1.2.1.1 . I will inform you for any changes. Thanks to mention it and sorry for this.
Posted Image

#5 Ruedische

Ruedische

    Member

  • Members
  • PipPip
  • 12 posts

Posted 18 April 2012 - 07:43 PM

In addition: It doesn't work in IE 8 and Chrome (not even insert). Safari and Opera show the same behavior as Firefox (all on Win - latest browser versions; except IE of course).

#6 web-johnny

web-johnny

    grocery CRUD Author

  • Administrators
  • 1,099 posts
  • LocationLondon

Posted 18 April 2012 - 09:34 PM

Sorry for that. The set type was a contribution code and I didn't tested properly. You can look at the changes at: https://github.com/s...4ffa6487306d200 or you can simply just download and replace the library grocery_crud with this one: Attached File  grocery_crud.php   118.16K   474 downloads

Now this works fine for ALL the browsers and OS systems and in IE 8 too.
Posted Image

#7 web-johnny

web-johnny

    grocery CRUD Author

  • Administrators
  • 1,099 posts
  • LocationLondon

Posted 18 April 2012 - 10:13 PM

I edited your title so we can help more people with a similar problem.
Posted Image

#8 Kenta Saito

Kenta Saito

    Advanced Member

  • Members
  • PipPipPip
  • 34 posts
  • LocationTokyo JAPAN

Posted 19 April 2012 - 12:46 AM

I am very sorry. My code made users a problem.
And Johnny. Thank you for fix that.

Edit Signature TEST

#9 Ruedische

Ruedische

    Member

  • Members
  • PipPip
  • 12 posts

Posted 19 April 2012 - 06:35 AM

Muchas gracias for the quick fixing of that issue!

#10 Ruedische

Ruedische

    Member

  • Members
  • PipPip
  • 12 posts

Posted 19 April 2012 - 07:45 AM

Oh, I'm sorry, but there is now another problem. I've replaced the library file, now I get PHP Errors (Notices), and my Input-Fields look weird (kind of shrinked). After Updating the result message appears inside a textarea.
A PHP Error was encountered
Severity: Notice
Message: Undefined index: form_inactive
Filename: libraries/grocery_crud.php
Line Number: 2916
A PHP Error was encountered
Severity: Notice
Message: Undefined index: form_active
Filename: libraries/grocery_crud.php
Line Number: 2916


#11 web-johnny

web-johnny

    grocery CRUD Author

  • Administrators
  • 1,099 posts
  • LocationLondon

Posted 19 April 2012 - 08:07 AM

This is a fix only for grocery CRUD version 1.2.1 So just update your version to 1.2.1.1 and copy ALL the files and folders to your project. Just go to the http://www.grocerycrud.com/downloads and download the latest one.
Posted Image

#12 Ruedische

Ruedische

    Member

  • Members
  • PipPip
  • 12 posts

Posted 19 April 2012 - 11:40 AM

I thought so and did an update. Error messages are gone, also the CSS weirdness, but the success-message after updating a record (with a set-field) appears only in a teaxtarea-field (Firefox used). This is strange. - After updating nothing else is shown on the page. This is even stranger.


grocery_crud_update_with_set_field.png

#13 web-johnny

web-johnny

    grocery CRUD Author

  • Administrators
  • 1,099 posts
  • LocationLondon

Posted 19 April 2012 - 05:51 PM

This is not weird for me. You defenetly have problem with your Javascript. So the CSS weirdness and the textarea means that your javascript doesn't work properly. Please try again for a last time to copy all the files included the themes file. If again it doesn't work then can you attach your firebug console (with the error) because you have for sure a Javascript error, but I don't know why. So for example I need something like this: error-in-firebug.png
Posted Image

#14 Ruedische

Ruedische

    Member

  • Members
  • PipPip
  • 12 posts

Posted 20 April 2012 - 03:45 PM

Since yesterday I've made some changes in my application. I didn't use the set data type anymore ... Now I've changed back from varchar to set - and it works! Maybe, there was a typo in my script (required fields ... unset texteditor), who knows. THX for grocerycrud. It helped me a lot.

One suggestion:
I don't use TinyMCE, so it would be nicer to have the texteditor unset by default instead of set. I 'm using Textile-Markup (Textile Class from Textpattern) and have second columns for HTML (parsed textile) in my database (filled by callback function). Textile is only for backend. Frontend code reads the HTML columns. Why Textile? I need definition lists. They are easy in textile (; dd :dt), Tiny sucks.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users