#2793 closed Defect (fixed)
run_function_once -> datalist
| Reported by: | coldtrick | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Elgg 1.7.7 |
| Component: | Core | Version: | 1.7 |
| Severity: | minor | Keywords: | run_function_once, run_once, datalist |
| Cc: | brett@… | Difficulty: | easy |
Description
When you try to execute a run_function_once with a function name longer then 32 chars there is a problem.
Since in datalist the 'name' column is a varchar(32) function name are limited to 32 chars, if you have more chars then run_function_once will always run.
Change History (3)
comment:1 Changed 2 years ago by cash
- Difficulty set to easy
- Milestone changed from Needs Review to Elgg 1.7.7
comment:2 Changed 2 years ago by cash
- Resolution set to fixed
- Status changed from new to closed
(In [svn:7961]) Fixes #2793 added logic to handle variable names longer than 32 characters
comment:3 Changed 2 years ago by brettp
(In [svn:8363]) Refs #2793, #2956. Ported run_function_once() and datalist_get/set() changes for values > 32 chars to trunk.
Note: See
TracTickets for help on using
tickets.

I'm looking forward to Elgg adding the ability to register functions to be run when a plugin is enabled (in 1.8). I think the run_function_once() is a dangerous functions because it is so easy to use and can cause so much database overhead.
In trunk, I've added a check in elgg_save_config() for strings longer than 32 characters. We need to put these checks in the core functions that write to datalist. We also need to think about going from 32 characters to 64.