Wrong custom field default value for existing records

2 views
Skip to first unread message

Alexander Obuhovich

unread,
Oct 8, 2012, 8:20:24 AM10/8/12
to Bugs In-Portal
When new custom field is added, then records, that were already created before that time has NULL as that custom field value instead of actual default value.


I propose that we do a single UPDATE statement to custom field table to put default values in place for existing records.
However action can't be repeated on same custom field default value changes because now all existing records have value for it.


--
Best Regards,

http://www.in-portal.com
http://www.alex-time.com

Alexander Obuhovich

unread,
Oct 8, 2012, 8:30:36 AM10/8/12
to Bugs In-Portal
Maybe we shouldn't do this automatically, but add a toolbar button and allow user to fill fields with NULL values when there is a need.

Dmitry A.

unread,
Oct 24, 2012, 2:06:10 AM10/24/12
to in-port...@googlegroups.com
Hi Alex,

I agree we should run that UPDATE. Would you please create a task and SQL statement that will go into upgrades.sql script?

DA

Alexander Obuhovich

unread,
Nov 5, 2012, 4:45:42 AM11/5/12
to Bugs In-Portal
What about automatic VS non-automatic update?

As I've mentioned before it's action that can't be undone in case if administrator will set "A" as default value and then "B" as default value.


--
You received this message because you are subscribed to the Google Groups "In-Portal Bugs Team" group.
To view this discussion on the web visit https://groups.google.com/d/msg/in-portal-bugs/-/1ob_vT3XIbsJ.
To post to this group, send email to in-port...@googlegroups.com.
To unsubscribe from this group, send email to in-portal-bug...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/in-portal-bugs?hl=en.

Dmitry A.

unread,
Nov 12, 2012, 1:34:10 AM11/12/12
to in-port...@googlegroups.com
The real question is how often we came across a need to set Custom field to NULL.

I think it's it gets this advanced it can/should also be done via PMA or something. What do you think?


DA

Alexander Obuhovich

unread,
Nov 18, 2012, 4:01:43 PM11/18/12
to Bugs In-Portal
The case is very simple - new feature added to website, that requires new custom field to be added, however some data is already entered to database.

Maybe this implementation would make it easier to use:
  1. select a custom field (one or several) from the custom field list
  2. press "Populate Defaults" toolbar button (new)
  3. one UPDATE sql will be quickly issued for each of selected custom fields
Only custom fields that:
  • have NULL as their value
  • on primary language
will be updated.





To view this discussion on the web visit https://groups.google.com/d/msg/in-portal-bugs/-/JogIK2rMePoJ.

To post to this group, send email to in-port...@googlegroups.com.
To unsubscribe from this group, send email to in-portal-bug...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/in-portal-bugs?hl=en.
Reply all
Reply to author
Forward
0 new messages