1 edb Apr 23, 2009 02:47
3 edb Apr 23, 2009 03:16
And there you go! I put it in as die('die here '.$this-ID); just to make sure I saw where it was supposed to be in the event there was no ID ... which was fairly obviously the problem ... and sure enough it had no ID value. So I moved it up one line - above the IF that decides if we're going to bother with that query. STILL no value for ID. So I started asking myself what changed between a query that knew the plugin's ID and a query that didn't. Are you ready?
I TOLD IT $this-ID = ''; as the default value for a field in the table that happens to be autoincremented. I don't even *need* that value because it never shows up in the form - just gives me something to use to keep track of what's being edited or updated.
So to be double-plus certain that the problem doesn't rear it's ugly head again I'll rename the ID field as something like myID, and, not bother having it handy for a form that doesn't care about it.
Well done sam2kb!
4 edb Apr 23, 2009 03:30
YAY! Took a bit to do the edits and upload and test, but I can now report success in this mission. Onward and upward eh? This plugin has NO settings. THAT is completely unacceptable! Oh and it doesn't actually do anything yet. I mean, it does stuff but nothing that actually adds value to anyone's life. So if I had a lot of settings and an actual product it'd be way cooler.
5 sam2kb Apr 23, 2009 03:34
I TOLD IT $this-ID = '';
:D
Make sure you don't kill other properties like 'name', 'version' etc.
6 edb Apr 23, 2009 04:01
Yeah it's messed up. Initially and normally I gave/give table fields uselessly long names. In this case since it is a readme writer I had called them all "rmw_whatever". Well with 122 fields I decided that rmw_ represented 4*122 characters I could pull out of multiple locations, thus shrinking the file size a wee bit.
So the bestest answer, rather than worrying about what might be officially used by the core, is to put that 'bloat' back in eh? Meaning a plugin that writes a table always has field names that begin with something reasonably unique to the plugin itself.
Blech. It was easy to find all of them and replace them with nothing. Not so easy to put 'em back where they belong :(
Try this
Do you get the ID?