Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#229 2013-04-01 21:29:14

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: smd_bio : store additional biographical info about your users

I’m having trouble using smd_bio with smd_user_manager. Here’s the issue: When I have smd_user_manager active, I cannot save changes to smd_bio fields where I’ve defined custom radio options. If I disable smd_um, I can go to the Users tab, select an author, and save changes to those fields, but not when smd_um is active. Has anyone seen this behavior before?

Offline

#230 2013-05-16 19:45:35

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: smd_bio : store additional biographical info about your users

New problem: I’m working on a local development server, and I keep seeing this error message when I view the smd_bio tab to finish installing the plugin:

I’m sorry. I’m afraid I can’t do that; smd_bio is an unsafe operation.

I was getting the same “unsafe operation” error message on the rah_sitemap tab, but installing the latest version of rah_sitemap fixed that problem.

I created a clean TXP install with nothing else to try to isolate the issue, and I get the same results.

I’m running Mac OS 10.8.3 with PHP 5.3.15, MySQL 5.6.10, and Apache/2.2.22 (Unix) DAV/2 PHP/5.3.15 with Suhosin-Patch mod_ssl/2.2.22 OpenSSL/0.9.8r. My hunch is that it has something to do with my local PHP configuration, but I don’t actually know. I haven’t done any custom PHP configuration— all I did was uncomment the LoadModule php5_module libexec/apache2/libphp5.so line in my httpd.conf file.

Can anyone offer any insight toward getting this plugin working on this machine?

Offline

#231 2013-05-16 20:33:45

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,446
Website GitHub

Re: smd_bio : store additional biographical info about your users

johnstephens

Sorry for not replying sooner. What versions of the plugins are you using? Assuming you’re on Txp 4.5.x, the betas should work ok together as I’ve updated them recently to fix some random issues.

smd_bio in particular was fine for upgrades but wouldn’t install properly on fresh installations, which had a knock-on effect down the line. And smd_um had some UI inconsistencies which led to strange results. Would you please try downloading them again from that page and see if things improve? If not, we’ll go from there to find what’s occurring.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#232 2013-05-17 13:32:11

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: smd_bio : store additional biographical info about your users

Thank you, Stef! I will test it later today and report back.

Offline

#233 2013-05-20 18:37:46

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: smd_bio : store additional biographical info about your users

Okay, I installed the smd_bio v0.40 beta on two locally-hosted development sites. One site used the latest non-beta version of smd_bio already, and attempting to install v0.40 threw an error. I was able to bypass the error by deleting the existing plugin before installing the beta.

I also installed smd_um v0.20 beta on the development site where I need it without any trouble.

The first thing I notice looking at a random user entry is that all the custom Bio fields are gone. Clicking over the the “Bio config” panel (smd_bio), all the fields are indeed gone. Looking at the database in phpMyAdmin, I see that the tables for `smd_bio` and ``smd_bio_meta` are both empty. Is that supposed to happen? I can restore the DB from a backup, but is there any way to transition from the previous version of smd_bio without destroying my data? I don’t want to re-enter all that info on the live version of the site.

Thanks again for your guidance, Stef!

Offline

#234 2013-05-20 19:41:36

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: smd_bio : store additional biographical info about your users

Update: After restoring the smd_bio data on my local dev install, I installed both plugins on the live site and I didn’t experience either problem noted above. smd_bio v0.40 installed without having to delete the existing plugin first, and it didn’t remove all my data. I’m not sure what went wrong with the local version, but it worked fine on the live site.

Cheers!

Offline

#235 2013-05-20 20:30:08

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,446
Website GitHub

Re: smd_bio : store additional biographical info about your users

johnstephens wrote:

attempting to install v0.40 threw an error.

Can you remember what the error was, offhand? I thought I’d cracked it, but maybe there’s more work to be done here.

Errors like this may be due to limited MySQL permissions, because it does some wrangling to change table field types and insert new columns. If your local MySQL user didn’t have All permissions then it may have failed during upgrade. Just a hunch.

I was able to bypass the error by deleting the existing plugin before installing the beta.

Right, when you delete the plugin, it tidies up after itself and deletes your bio data. Ahem, as you found. The upgrade path is supposed to be a simple overwrite of the existing plugin, but having a pref to leave the data alone on delete would be handy. I’ll add it to the To-Investigate list. But good prudence prevailed and you had a backup: phew!

Incidentally, if you happen to have ied_plugin_composer installed, you can configure it to not fire ‘delete’ lifecycle events so in future if you delete plugins from the Plugin Composer’s panel, the bio data would have been preserved.

Last edited by Bloke (2013-05-20 20:30:34)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#236 2013-07-02 02:34:39

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: smd_bio : store additional biographical info about your users

Is there a way to use article data in a Select List? I have Team articles and I want to assign a User to a Team.

Like how glz_custom_fields does maybe?

Last edited by MattD (2013-07-02 02:39:08)


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#237 2013-07-02 12:11:18

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,446
Website GitHub

Re: smd_bio : store additional biographical info about your users

MattD wrote:

Is there a way to use article data in a Select List? I have Team articles and I want to assign a User to a Team.

From the public side or admin side? At the moment there’s no way to inject data into lists on the fly, but I could look into adding a callback if it’s of any use to you. Not sure how it could be done easily on the public side: might need some brain power.

The only way to get custom list data at the moment is to use the SMD_BIO_FN call when defining the field, which is a one-shot approach: the data from your function will be inserted into the field in place of the function call when you save the bio data from the Bio Config panel. So in your case you could write a one-line function to populate the field with all current articles and they’d get injected into the field for you, but if any other articles came along they wouldn’t be selectable unless you put the function name in again and resaved the Bio Config.

Some way of deferring the list of items might be quite handy but I haven’t thought through how the plugin would handle deletions or default items. Deletions are probably fairly easy: in your case if someone deleted a Team article and a user was assigned to it, the plugin would just not be able to select the missing value so would default to the empty / first option (although as far as the database is concerned, the old value would still be there, which might cause a mismatch at some point if you were displaying values on a public site: the admin side would show ‘nothing selected’ but the database would have a value against that field — albeit one that isn’t in the list).

I would probably stipulate that your callback function must return an array of values, so you would need to be able to signal to smd_bio that certain options are default. Perhaps if the callback occurred early enough then you could use the same syntax as you would do if it was a static list: using [*] to indicate default options. The plugin would then just use your list instead of the one defined in the value.

It might just work out OK. Let me look into it and get back to you.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#238 2013-07-03 05:13:46

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: smd_bio : store additional biographical info about your users

Sounds like I might be better off injecting the options via JavaScript. I was thinking admin side but now that you mention it…


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#239 2013-07-03 15:16:30

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: smd_bio : store additional biographical info about your users

Oh, Stef. Heaven bless you, I am becoming a terror to this plugin thread.

So this is just a report.

I’m running smd_bio v0.40 (beta). When I try to add a new bio field using the Bio Config panel on my development server, I get this message:

Internal error “Incorrect integer value: ‘’ for column ‘colsize’ at row 1”
in /path/to/textpattern/lib/txplib_db.php at line 95.
adminErrorHandler()
textpattern/lib/txplib_db.php:95 trigger_error()
textpattern/lib/txplib_db.php:129 safe_query()
textpattern/lib/txplib_misc.php(812) : eval()’d code:450 safe_insert()
textpattern/lib/txplib_misc.php(812) : eval()’d code:101 smd_bio_meta_add()

I’m sorry. I’m afraid I can’t do that; smd_bio smd_bio_meta_add is an unsafe operation.

The relevant field is added to the smd_bio table, but not smd_bio_meta, which creates errors later if I try to add the same field again. I have to delete the entry in smd_bio manually.

I’m running the same plugin with the same site configuration on my publish server, and I can add new bio fields just fine.

As a workaround, I added all the fields I need (currently) on the publish server, exported the relevant tables, then imported them into database on my dev server. Woo!

I don’t know if you’ve seen this before, but I just wanted to let you know! Thank you, Stef!

Offline

#240 2013-07-03 15:34:52

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,446
Website GitHub

Re: smd_bio : store additional biographical info about your users

johnstephens wrote:

Internal error “Incorrect integer value: ‘’ for column ‘colsize’ at row 1”

Eeek, not seen that one before. Would you mind letting me know what type of field you were trying to create, with what options, defaults and stuff. I may be able to replicate it and fix it.

And if you toggle out the ‘more’ twisty, what column type and size is your field trying to create? As you change the type of field, the coltype and colsize should adjust themselves to suit. For example, ‘Image’ should be an Integer, while Email should be varchar with 254 size. If that’s not happening it might be a jQuery thing, so see if you can spot any javascript errors in the Firebug console. Thanks.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB