Michael Thomsen wrote:
> I'm trying to write a plugin for ActionStream which adds support for
> Slashdot, but to do that I need more complex functionality than what
> scraper or xpath provide in ActionStreams. Is it possible for me to
> have the action_stream in a config.yaml file for the plugin execute a
> Perl function instead of running the scraper or doing xpath?
Yes, see "Custom collectors" in the recipe guide provided with the
development version of the plugin (most of it applies to 1.0 as well):
<http://code.sixapart.com/svn/mtplugins/trunk/ActionStreams/plugins/ActionStream\
s/doc/recipe-guide.txt>
See the plugin's implementation of the Vox favorites stream for an
example. If you need only clean settings up after xpath or scraper
rules, also check out the "Cleaning up after your stream" and "Stream
recipe callback reference" sections. There are several examples in the
AS plugin.
HTH.
Mark Paschal
mark@...
Hello all. I'm putting out an updated version of our MT plugin and am having some issues with the upgrade scripts b/c I need to up the schema version. For the DB table change, I "simply" want to drop one column (a password field) and add another (an api key field). Because of that, I need to do something like this:
* add the new column to the table * for each Object, retrieve it and: - login to our web service to get the proper api_key - update the new column with the key * drop the column from the table
Honestly, I sincerely doubt anyone using this has actually set this up on more than one blog, so even adding/dropping the column during the "for each" would likely be fine, though I would rather do it right just in case.
I've been trying to accomplish this using the "upgrade_functions" param when I init my plugin as shown here:
Of course I've also updated my Custom Object's "install_properties", removing the one field & adding the other.
So far the upgrade script is running, but this is all I see: --- * Upgrading table for mailchimp_list records...
* Plugin 'MailChimp Subscribe Form' upgraded successfully to version 1.1 (schema version 1.1). --- From what I can tell, my "updater" "code" is not being run at all. When I check the db table, I can see that the new column is added, but the old column is not being removed. Given that result, I'm pretty sure I could hack in some code to clean things up in my plugin code, but I'd really rather do it the right way.
I've really tried digging through some other plugins and the core MT code, and am just not having any luck figuring this out.
Oh, also, I'm running MT 4.1.
Any help or suggestions anyone can provide would be greatly appreciated.
Jesse,
Its hard to be specific since you haven't posted any code but...
I don't think the MT api will remove the column. It is pretty good
add schema changes to add or modify existing columns, but I don't
think there is any logic in there to remove a column (but I am not
100% sure).
That said, since the new column is getting added, the remaining item is:
> * for each Object, retrieve it and:
> - login to our web service to get the proper api_key
> - update the new column with the key
And for this, your are correct, an upgrade function is the way to go.
I can't comment on what isn't working for you, of course.
Here's an example from one my plugins:
snippet from my .pl file, to register the upgrade function"
'upgrade_functions' => {
'import_images' => {
version_limit => 1.231, # runs for schema_version < 1.231 --
plugin version 1.5x
updater => {
type => 'author',
label => 'Importing author photos...',
condition => sub { !$_[0]->userpic_asset_id },
code => '$UserProfile::UserProfiles::Pro::Util::import_images',
}
},
},
and the function itself:
sub import_images {
my ($author) = @_;
return if $author->userpic_asset_id;
...code here to import image, create asset, etc. (you api
fetching stuff would go here)
# now update the object
$author->userpic_asset_id($asset->id)
or MT->log("Error adding asset to author: " . $author->errstr);
$author->save;
}
As you work on it, try to log any errors to the MT activity log, or to
STDERR, as that can help identify issues along the way...
Hope this helps,
Mark
On Thu, Aug 28, 2008 at 2:02 PM, jesse <jessedp@...> wrote:
> Hello all. I'm putting out an updated version of our MT plugin and am having
> some issues with the upgrade scripts b/c I need to up the schema version.
> For the DB table change, I "simply" want to drop one column (a password
> field) and add another (an api key field). Because of that, I need to do
> something like this:
>
> * add the new column to the table
> * for each Object, retrieve it and:
> - login to our web service to get the proper api_key
> - update the new column with the key
> * drop the column from the table
>
> Honestly, I sincerely doubt anyone using this has actually set this up on
> more than one blog, so even adding/dropping the column during the "for each"
> would likely be fine, though I would rather do it right just in case.
>
> I've been trying to accomplish this using the "upgrade_functions" param when
> I init my plugin as shown here:
>
>
>
http://www.movabletype.org/documentation/developer/movable-type-registry-referen\
ce.html
>
> Of course I've also updated my Custom Object's "install_properties",
> removing the one field & adding the other.
>
> So far the upgrade script is running, but this is all I see:
> ---
> * Upgrading table for mailchimp_list records...
> * Plugin 'MailChimp Subscribe Form' upgraded successfully to version 1.1
> (schema version 1.1).
> ---
> From what I can tell, my "updater" "code" is not being run at all. When I
> check the db table, I can see that the new column is added, but the old
> column is not being removed. Given that result, I'm pretty sure I could hack
> in some code to clean things up in my plugin code, but I'd really rather do
> it the right way.
>
> I've really tried digging through some other plugins and the core MT code,
> and am just not having any luck figuring this out.
>
> Oh, also, I'm running MT 4.1.
>
> Any help or suggestions anyone can provide would be greatly appreciated.
>
> thanks,
>
>
> jesse
>
>
Thanks for the reply, Mark. Sorry for not posting code, but I had literally followed the example on the page I referenced to the tee. Anywho, here's my "upgrade_functions" setup:
When I wrote 1st, it was: code=> sub { //do stuff }
Just to follow the way you did it, I split off the code into another module. One thing I meant to ask the 1st time is what "type" is supposed to be. I've randomly swapped it around with different things - "list" is there now b/c it is the name of the object type the custom object I am messing with is defined as:
object_types => { 'list' => 'MailChimp::ListDetails', },
I did stick some print STDERR lines in the function that references, but don't see anything occur.
On that note, it is completely possible that I'm missing something that should be logged or debugged - b/c I can't find *anything* anywhere. I remember getting stack traces & such on screen when I was writing this the 1st time, and still have DebugMode set to 3, but I don't see anything anywhere. I've actually had to add code back in line-by-line to see what caused the plugin to fail to load, which is wonky and tedious. Any suggestions for that would be wonderful. I'd love to just have it dumped in a file somewhere that I can tail.
thanks,
jesse
On Thu, Aug 28, 2008 at 13:41, Mark Carey <mtpronet@...> wrote:
Jesse,
Its hard to be specific since you haven't posted any code but...
I don't think the MT api will remove the column. It is pretty good
add schema changes to add or modify existing columns, but I don't
think there is any logic in there to remove a column (but I am not
100% sure).
That said, since the new column is getting added, the remaining item is:
> * for each Object, retrieve it and:
> - login to our web service to get the proper api_key
> - update the new column with the key
And for this, your are correct, an upgrade function is the way to go.
I can't comment on what isn't working for you, of course.
Here's an example from one my plugins:
snippet from my .pl file, to register the upgrade function"
sub import_images {
my ($author) = @_;
return if $author->userpic_asset_id;
...code here to import image, create asset, etc. (you api
fetching stuff would go here)
# now update the object
$author->userpic_asset_id($asset->id)
or MT->log("Error adding asset to author: " . $author->errstr);
$author->save;
}
As you work on it, try to log any errors to the MT activity log, or to
STDERR, as that can help identify issues along the way...
Hope this helps,
Mark
On Thu, Aug 28, 2008 at 2:02 PM, jesse <jessedp@...> wrote:
> Hello all. I'm putting out an updated version of our MT plugin and am having
> some issues with the upgrade scripts b/c I need to up the schema version.
> For the DB table change, I "simply" want to drop one column (a password
> field) and add another (an api key field). Because of that, I need to do
> something like this:
>
> * add the new column to the table
> * for each Object, retrieve it and:
> - login to our web service to get the proper api_key
> - update the new column with the key
> * drop the column from the table
>
> Honestly, I sincerely doubt anyone using this has actually set this up on
> more than one blog, so even adding/dropping the column during the "for each"
> would likely be fine, though I would rather do it right just in case.
>
> I've been trying to accomplish this using the "upgrade_functions" param when
> I init my plugin as shown here:
>
>
> http://www.movabletype.org/documentation/developer/movable-type-registry-reference.html
>
> Of course I've also updated my Custom Object's "install_properties",
> removing the one field & adding the other.
>
> So far the upgrade script is running, but this is all I see:
> ---
> * Upgrading table for mailchimp_list records...
> * Plugin 'MailChimp Subscribe Form' upgraded successfully to version 1.1
> (schema version 1.1).
> ---
> From what I can tell, my "updater" "code" is not being run at all. When I
> check the db table, I can see that the new column is added, but the old
> column is not being removed. Given that result, I'm pretty sure I could hack
> in some code to clean things up in my plugin code, but I'd really rather do
> it the right way.
>
> I've really tried digging through some other plugins and the core MT code,
> and am just not having any luck figuring this out.
>
> Oh, also, I'm running MT 4.1.
>
> Any help or suggestions anyone can provide would be greatly appreciated.
>
> thanks,
>
>
> jesse
>
>
On Thu, Aug 28, 2008 at 3:15 PM, jesse <jessedp@...> wrote:
>"list" is there now b/c
> it is the name of the object type the custom object I am messing with is
> defined as:
> object_types => {
> 'list' => 'MailChimp::ListDetails',
> },
This is correct, it must match the object type you have defined. Each
object passing the "condition" will get passed to the "code" function,
so your first line might be
my ($list) = @_;
...and you can manipulate and save the object from there.
> Any
> suggestions for that would be wonderful. I'd love to just have it dumped in
> a file somewhere that I can tail.
You could try Jay Allens log4mt tool [1]. I haven't tried it myself
yet, but I plan to, as it sounds quite helpful.
-Mark
[1] https://trac.endevver.com/movabletype/wiki/plugins/log4mt
Turns out I wasn't paying attention to the ever so important placement of a closing brace, so my entire upgrade_functions section was not in the registry section. Oops.
On a side note, logging to stderr works out perfectly b/c I can just tail my apache error log to see what's happening. I imagine I'll be fine from here on out.
thanks again for the help, Mark.
jesse
On Thu, Aug 28, 2008 at 15:25, Mark Carey <mtpronet@...> wrote:
On Thu, Aug 28, 2008 at 3:15 PM, jesse <jessedp@...> wrote:
>"list" is there now b/c
> it is the name of the object type the custom object I am messing with is
> defined as:
> object_types => {
> 'list' => 'MailChimp::ListDetails',
> },
This is correct, it must match the object type you have defined. Each
object passing the "condition" will get passed to the "code" function,
so your first line might be
my ($list) = @_;
...and you can manipulate and save the object from there.
> Any
> suggestions for that would be wonderful. I'd love to just have it dumped in
> a file somewhere that I can tail.
You could try Jay Allens log4mt tool [1]. I haven't tried it myself
yet, but I plan to, as it sounds quite helpful.
I have a template file in a plugin that I need to compile and write
the HTML to a separate directory. I've seen the following way to
initialize a MT::Template::Context object to pass to
MT::Template->build, but it causes an error. This is use in the docs:
my $ctx = MT::Template::Context->new();
Yet when I run that in a callback method attached to MT::Comment, I
get the following error in my error log:
died with: Can't call method "server_offset" on an undefined value at
lib/MT/Template/ContextHandlers.pm line 10075.
All I need to do is load the template, build it to HTML, and write it
to a file. How should I setup the Context so that I can do this?
On Sep 2, 2008, at 16:25, "Michael Thomsen" <mikerthomsen@...> wrote:
I have a template file in a plugin that I need to compile and write
the HTML to a separate directory. I've seen the following way to
initialize a MT::Template::Context object to pass to
MT::Template->build, but it causes an error. This is use in the docs:
my $ctx = MT::Template::Context->new();
Yet when I run that in a callback method attached to MT::Comment, I
get the following error in my error log:
died with: Can't call method "server_offset" on an undefined value at
lib/MT/Template/ContextHandlers.pm line 10075.
All I need to do is load the template, build it to HTML, and write it
to a file. How should I setup the Context so that I can do this?
4.21 Pro
On Tue, Sep 2, 2008 at 6:28 PM, Timothy Appnel <tim@...> wrote:
> What version are you working with?
>
> Sent from my iPhone
> On Sep 2, 2008, at 16:25, "Michael Thomsen" <mikerthomsen@...> wrote:
>
> I have a template file in a plugin that I need to compile and write
> the HTML to a separate directory. I've seen the following way to
> initialize a MT::Template::Context object to pass to
> MT::Template->build, but it causes an error. This is use in the docs:
>
> my $ctx = MT::Template::Context->new();
>
> Yet when I run that in a callback method attached to MT::Comment, I
> get the following error in my error log:
>
> died with: Can't call method "server_offset" on an undefined value at
> lib/MT/Template/ContextHandlers.pm line 10075.
>
> All I need to do is load the template, build it to HTML, and write it
> to a file. How should I setup the Context so that I can do this?
>
>
If you already have a template object (from the db) loaded, you can do:
my $ctx = $tmpl->context;
The error is because your context does not include a blog context --
it can't find $blog->server_offset because the blog is undefined. I
believe that using the method above will inherit the blog context of
the template in question, this avoiding this error.
-Mark
On Tue, Sep 2, 2008 at 5:25 PM, Michael Thomsen <mikerthomsen@...> wrote:
> I have a template file in a plugin that I need to compile and write
> the HTML to a separate directory. I've seen the following way to
> initialize a MT::Template::Context object to pass to
> MT::Template->build, but it causes an error. This is use in the docs:
>
> my $ctx = MT::Template::Context->new();
>
> Yet when I run that in a callback method attached to MT::Comment, I
> get the following error in my error log:
>
> died with: Can't call method "server_offset" on an undefined value at
> lib/MT/Template/ContextHandlers.pm line 10075.
>
> All I need to do is load the template, build it to HTML, and write it
> to a file. How should I setup the Context so that I can do this?
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>
Hmmm, see I'm loading the template from a plugin directory, not the
database. Do I need to register the tmpl file in the registry to make
this easier?
On Wed, Sep 3, 2008 at 8:17 AM, Mark Carey <mtpronet@...> wrote:
> If you already have a template object (from the db) loaded, you can do:
>
> my $ctx = $tmpl->context;
>
> The error is because your context does not include a blog context --
> it can't find $blog->server_offset because the blog is undefined. I
> believe that using the method above will inherit the blog context of
> the template in question, this avoiding this error.
>
> -Mark
>
> On Tue, Sep 2, 2008 at 5:25 PM, Michael Thomsen <mikerthomsen@...>
> wrote:
>> I have a template file in a plugin that I need to compile and write
>> the HTML to a separate directory. I've seen the following way to
>> initialize a MT::Template::Context object to pass to
>> MT::Template->build, but it causes an error. This is use in the docs:
>>
>> my $ctx = MT::Template::Context->new();
>>
>> Yet when I run that in a callback method attached to MT::Comment, I
>> get the following error in my error log:
>>
>> died with: Can't call method "server_offset" on an undefined value at
>> lib/MT/Template/ContextHandlers.pm line 10075.
>>
>> All I need to do is load the template, build it to HTML, and write it
>> to a file. How should I setup the Context so that I can do this?
>>
>> ------------------------------------
>>
>> Yahoo! Groups Links
>>
>>
>>
>>
>
I have an object being passed to a template and can access it's fields just fine. The object represents a user-selected "list", of which there may be many. I wanted to display these in a select box so a different one can be easily changed. Obviously I'd like to set the "selected" option on the proper list entry. Here's the code I've been trying to get working:
------------------------------------------------ <mt:SetVar name="lid" value="@list-list_id"> <select name="mc_list_id" size="3" style="min-width:200px;">
<mt:loop name="lists" sort_by="name"> <option value='<$mt:var name="id"$>' <mt:if name="id" eq="$lid"> selected </mt:if> > <$mt:var name="name"$> </option>
</mt:loop> </select> ------------------------------------------------ The piece that I can't get working is that mt:if on line 4. What I need to do is compare the var I'm setting on line one with the "id" var that I'm using as the option value on line 4. I've also tried several variations of things in the mt:if "eq" param to no avail instead of using mt:setvar.
Am I going about this in the correct way? Is this possible?
On Wed, Sep 3, 2008 at 10:55 AM, jesse <jessedp@...> wrote:
> <option value='<$mt:var name="id"$>' <mt:if name="id" eq="$lid">
In this line you seem to be creating $id but not setting it to
anything, and then testing if it equals $lid. That obviously won't
because you never gave $id a value.
Is there some other place further up/down where you /do/ assign
something to $id?
Su, on the line you referenced, "id" is coming from the "lists" object (it maybe a hash) used in my mt:loop. Also notice that it's a "var", not a "setvar". That's just printing the "id" as the value for that option tag - it works fine.
The "lid" I am trying to compare to came from the 1st line of the original code. To be clear, if I try to print "list-list_id", using mt:var, it works just fine. Now I just need to compare that to "id" inside my mt:loop
Since it got dropped in the reply, here it is again: --------------------- <mt:SetVar name="lid" value="@list-list_id"> <select name="mc_list_id" size="3" style="min-width:200px;">
<mt:loop name="lists" sort_by="name"> <option value='<$mt:var name="id"$>' <mt:if name="id" eq="$lid"> selected </mt:if> > <$mt:var name="name"$> </option>
</mt:loop> </select> ---------------------
On Wed, Sep 3, 2008 at 10:55 AM, jesse <jessedp@...> wrote:
> <option value='<$mt:var name="id"$>' <mt:if name="id" eq="$lid">
In this line you seem to be creating $id but not setting it to
anything, and then testing if it equals $lid. That obviously won't
because you never gave $id a value.
Is there some other place further up/down where you /do/ assign
something to $id?
On Wed, Sep 3, 2008 at 9:39 AM, Michael Thomsen <mikerthomsen@...> wrote:
> Hmmm, see I'm loading the template from a plugin directory, not the
> database.
In that case, you were probably on the right track originally, but you
need add the blog context manually:
my $ctx = MT::Template::Context->new();
$ctx->{__stash}{'blog'} = $blog;
(of course, prior to this you need to load the blog object into $blog)
-Mark
Ok, that works. How do I pass it variable values so that tags like
<mt:var and <mt:loop can get populated? What I have right now is:
$params{items} = \@commentData;
$params{commenter_author_name} = $new->author();
my @blog = MT::Blog->load({id => $new->blog_id()});
my $ctx = MT::Template::Context->new();
$ctx->{__stash}{'blog'} = $blog[0];
$ctx->{__stash}{commenter_author_name} = $new->author();
my $output = $template->build($ctx, \%params);
On Wed, Sep 3, 2008 at 1:31 PM, Mark Carey <mtpronet@...> wrote:
> On Wed, Sep 3, 2008 at 9:39 AM, Michael Thomsen <mikerthomsen@...>
> wrote:
>> Hmmm, see I'm loading the template from a plugin directory, not the
>> database.
>
> In that case, you were probably on the right track originally, but you
> need add the blog context manually:
>
> my $ctx = MT::Template::Context->new();
> $ctx->{__stash}{'blog'} = $blog;
>
> (of course, prior to this you need to load the blog object into $blog)
>
> -Mark
>
Michael, you should be able to just shove any other variables you want into the $params hash you have setup there.
I'm not real great with my perl and what syntax is equivalent, but what works for me is like this:
my $pars = { 'error_msg'=>$error_msg, 'success_msg'=>$success_msg }; $params->{content}=$my_content; $params->{lists} = \@lists; my $output = $template->build($ctx, $params);
not certain if: $params{content} = $my_content;
is equivalent. I've fudged this a bit b/c I'm actually calling this when I build the template (just a slightly different way) $app->build_page( $tmpl , $pars );
But I'm pretty sure they build & build_page have the same method signatures.
Also, I included the "lists" param above b/c I am using that in mt:loop and it works fine (well, except for the other open question I sent this morning).
jesse
On Wed, Sep 3, 2008 at 13:54, Michael Thomsen <mikerthomsen@...> wrote:
Ok, that works. How do I pass it variable values so that tags like
<mt:var and <mt:loop can get populated? What I have right now is:
On Wed, Sep 3, 2008 at 1:31 PM, Mark Carey <mtpronet@...> wrote:
> On Wed, Sep 3, 2008 at 9:39 AM, Michael Thomsen <mikerthomsen@...>
> wrote:
>> Hmmm, see I'm loading the template from a plugin directory, not the
>> database.
>
> In that case, you were probably on the right track originally, but you
> need add the blog context manually:
>
> my $ctx = MT::Template::Context->new();
> $ctx->{__stash}{'blog'} = $blog;
>
> (of course, prior to this you need to load the blog object into $blog)
>
> -Mark
>
Thanks, but that doesn't seem to work with MT::Template->build. I was
logging the output, and each time it kept ignoring the params hash.
On Wed, Sep 3, 2008 at 2:04 PM, jesse <jessedp@...> wrote:
> Michael, you should be able to just shove any other variables you want into
> the $params hash you have setup there.
>
> I'm not real great with my perl and what syntax is equivalent, but what
> works for me is like this:
>
> my $pars = { 'error_msg'=>$error_msg, 'success_msg'=>$success_msg };
> $params->{content}=$my_content;
> $params->{lists} = \@lists;
> my $output = $template->build($ctx, $params);
>
> not certain if:
> $params{content} = $my_content;
>
> is equivalent. I've fudged this a bit b/c I'm actually calling this when I
> build the template (just a slightly different way)
> $app->build_page( $tmpl , $pars );
>
> But I'm pretty sure they build & build_page have the same method signatures.
>
> Also, I included the "lists" param above b/c I am using that in mt:loop and
> it works fine (well, except for the other open question I sent this
> morning).
>
>
> jesse
>
> On Wed, Sep 3, 2008 at 13:54, Michael Thomsen <mikerthomsen@...>
> wrote:
>>
>> Ok, that works. How do I pass it variable values so that tags like
>> <mt:var and <mt:loop can get populated? What I have right now is:
>>
>> $params{items} = \@commentData;
>> $params{commenter_author_name} = $new->author();
>> my @blog = MT::Blog->load({id => $new->blog_id()});
>> my $ctx = MT::Template::Context->new();
>> $ctx->{__stash}{'blog'} = $blog[0];
>> $ctx->{__stash}{commenter_author_name} = $new->author();
>>
>> my $output = $template->build($ctx, \%params);
>>
>> On Wed, Sep 3, 2008 at 1:31 PM, Mark Carey <mtpronet@...> wrote:
>> > On Wed, Sep 3, 2008 at 9:39 AM, Michael Thomsen <mikerthomsen@...>
>> > wrote:
>> >> Hmmm, see I'm loading the template from a plugin directory, not the
>> >> database.
>> >
>> > In that case, you were probably on the right track originally, but you
>> > need add the blog context manually:
>> >
>> > my $ctx = MT::Template::Context->new();
>> > $ctx->{__stash}{'blog'} = $blog;
>> >
>> > (of course, prior to this you need to load the blog object into $blog)
>> >
>> > -Mark
>> >
>
>
On Wed, Sep 3, 2008 at 2:54 PM, Michael Thomsen <mikerthomsen@...> wrote:
> Ok, that works. How do I pass it variable values so that tags like
> <mt:var and <mt:loop can get populated? What I have right now is:
While there is likely more than one way, here is one way to populate <mt:var>:
$ctx->var( 'commenter_author_name', $name );
For <mt:loop, it seems like what you are doing should work, but it may
depend on the structure of your array. Here a simple example
generalized from one of my plugins:
my @objects = $class->load({ foo => 'bar' });
my @data;
foreach my $obj (@objects) {
my $row = $obj->column_values;
push @data, $row;
}
$param->{my_items} = \@data;
-Mark
Yeah, that's the gist of what I was doing with the loop variable. It
was just a list with a series of hashes inside of it. Thanks for the
info!
On Thu, Sep 4, 2008 at 11:22 AM, Mark Carey <mtpronet@...> wrote:
> On Wed, Sep 3, 2008 at 2:54 PM, Michael Thomsen <mikerthomsen@...>
> wrote:
>> Ok, that works. How do I pass it variable values so that tags like
>> <mt:var and <mt:loop can get populated? What I have right now is:
>
> While there is likely more than one way, here is one way to populate
> <mt:var>:
>
> $ctx->var( 'commenter_author_name', $name );
>
> For <mt:loop, it seems like what you are doing should work, but it may
> depend on the structure of your array. Here a simple example
> generalized from one of my plugins:
>
> my @objects = $class->load({ foo => 'bar' });
> my @data;
> foreach my $obj (@objects) {
> my $row = $obj->column_values;
> push @data, $row;
> }
> $param->{my_items} = \@data;
>
> -Mark
>
Should boolean values in XML-RPC be passed as 'true'/'false', as 1/0,
or are both valid?
I'm using the Photon 1.2 iPhoto plug-in, which is sending the
MT::Placement->is_primary boolean as true/false, which MT's
XMLRPCServer.pm is not translating to 1/0. Subsequently when
MT::Object's save method is called (inherited by MT::Placement), the
is_primary value of 'true' is not stored in the DB as the boolean
field is a tinyint that is expecting a 1/0 value.
Is Photon at fault for not sending 1/0, or is MT's XMLRPCServer.pm
being incorrectly inflexible?
Many thanks!
Mikael Sheikh
I've been logging the results of $imageAsset->thumbnail_file() and all
I see is a numeric value. What do I need to do get usable path to the
thumbnail file?
Michael Thomsen wrote:
> I've been logging the results of $imageAsset->thumbnail_file() and all
> I see is a numeric value. What do I need to do get usable path to the
> thumbnail file?
thumbnail_file() returns multiple values: the URL as well as the width
and height of the image. If you only want the URL, call it like:
my ($url) = $imageAsset->thumbnail_file();
If you want all three, use:
my ($url, $width, $height) = $imageAsset->thumbnail_file();
HTH.
Mark Paschal
mark@...
Can anyone point me towards someone or some process that can reset the login attached to my plugin? Apparently the info I wrote down is incorrect or was changed, and I don't know the secret phrase. I've been trying to get in to update it for several weeks, but the places I've tried asking for help have yielded nothing so far. Here's the plugin: http://plugins.movabletype.org/mailchimp-signup-form/
If you can, please either send me some info or, if you are some that can help, feel free to contact me here or via the email address attached to that plugin.
There is a problem on the plugin directory right now -- even if you
can login successfully, there is no link to access your previously
submitted plugins for editing. Hopefully 6A will get that fixed
soon...
-Mark
On Mon, Oct 20, 2008 at 11:56 AM, jesse <jessedp@...> wrote:
> Can anyone point me towards someone or some process that can reset the login
> attached to my plugin? Apparently the info I wrote down is incorrect or was
> changed, and I don't know the secret phrase. I've been trying to get in to
> update it for several weeks, but the places I've tried asking for help have
> yielded nothing so far. Here's the plugin:
> http://plugins.movabletype.org/mailchimp-signup-form/
>
> If you can, please either send me some info or, if you are some that can
> help, feel free to contact me here or via the email address attached to that
> plugin.
>
>
> many thanks,
>
>
> Jesse
>
I'm trying to registry a couple of callbacks to run when an entry or
page is saved in the CMS. I have this in my config.yaml file.
callbacks:
WYSITidy_entry:
callback: MT::App::CMS::cmspresave.entry
handler: $WYSITidy::MT::Plugin::WYSITidy::pre_save
priority: 10
Debugging message say it does not run though. MT 4.21 displays it in
the list of plugins so its being recognized and read. What form have
others used?
One thing: I working off of these docs and the names seem off to
me(underscores?) or perhaps they where changed?
http://www.movabletype.org/documentation/developer/callbacks/
<tim/>
--
Timothy Appnel
Appnel Solutions
http://appnel.com/
I believe underscores is correct, as shown at:
http://www.movabletype.org/documentation/developer/callbacks/mtappcmscms-pre-sav\
etype.html
Just checked one of my plugins, and I have
MT::App::CMS::cms_post_save.entry and it works.
Seems like the TOC page you linked is stripping out the underscores,
whereas if you click through to each, the underscores are shown.
Byrne, it would be good to get that fixed ;)
-Mark
On Wed, Oct 22, 2008 at 12:53 PM, Timothy Appnel <tim@...> wrote:
> I'm trying to registry a couple of callbacks to run when an entry or
> page is saved in the CMS. I have this in my config.yaml file.
>
> callbacks:
> WYSITidy_entry:
> callback: MT::App::CMS::cmspresave.entry
> handler: $WYSITidy::MT::Plugin::WYSITidy::pre_save
> priority: 10
>
> Debugging message say it does not run though. MT 4.21 displays it in
> the list of plugins so its being recognized and read. What form have
> others used?
>
> One thing: I working off of these docs and the names seem off to
> me(underscores?) or perhaps they where changed?
>
> http://www.movabletype.org/documentation/developer/callbacks/
>
> <tim/>
>
> --
> Timothy Appnel
> Appnel Solutions
> http://appnel.com/
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>
Anyone out there have some experience debugging IE cross-domain cookie
domain issue?
I want to hear from you if you do. I have a client whose sign in
facilities stopped working for them when they upgraded to MT 4.21. It
only effects IE 6 & & browsers and the one blog not running under the
same domain name as MT. Contact me directly for more detail. There is
a bounty on this ones head.
Thanks.
<tim/>
--
Timothy Appnel
Appnel Solutions
http://appnel.com/