Major bug in plugin API for 11.2?

View: New views
4 Messages — Rating Filter:   Alert me  

Major bug in plugin API for 11.2?

by Jeffrey Kain :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

We're seeing a lot of old, tested plug-in code fail in 4D v11.2 when we
pass a dereferenced pointer parameter into a plug-in.

Stuff like:

  OT GetArray (...; $1->)   ` ObjectTools

Or

  AL_GetSelect (...; $1->) ` AreaList Pro

If we change the code to something like:

  $ptr:=$1
  Plugin_call (... ; $ptr->)
 
... it works fine.

At first we thought it was just ObjectTools, but now we're noticing it
in AreaList Pro as well. This is causing a bit of a problem for
backwards compatibility.

Jeff


**********************************************************************
4D Plugins hosted by 4D, Inc.                      http://www.4D.com/


    Did you know?  The 4D Partner Program now gives you
    access to Hotfix releases as soon as they are available!
    To learn more, go to http://www.4D.com/support/partner.html

To Unsubscribe:                      mailto:4D-Plugins-off@...
***********************************************************************


Re: Major bug in plugin API for 11.2?

by Matthias Schmidt-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Am/On Wed, 23 Jul 2008 17:16:45 -0400 schrieb/wrote Jeffrey Kain:

>We're seeing a lot of old, tested plug-in code fail in 4D v11.2 when we
>pass a dereferenced pointer parameter into a plug-in.
>
>Stuff like:
>
>  OT GetArray (...; $1->)   ` ObjectTools
>
>Or
>
>  AL_GetSelect (...; $1->) ` AreaList Pro
>
>If we change the code to something like:
>
>  $ptr:=$1
>  Plugin_call (... ; $ptr->)

imho this is good practice.

the above should work anyway.

>
>... it works fine.
>
>At first we thought it was just ObjectTools, but now we're noticing it
>in AreaList Pro as well. This is causing a bit of a problem for
>backwards compatibility.

don't you think this thread is more for the iNug as both plugins are
still using the old API.

cheers,

Matthias

------------------------------------------------------------------------
Admilon Consulting GmbH
Am Wiesengrund 9a, 90584 Allersberg, Germany
Geschäftsführer: Peter Frank, Matthias Schmidt
Amtsgericht Nürnberg: HRB 21750
Tel.: +49-9174 - 6646 Fax: +49-9174 - 6647
<http://www.admilon-consulting.de>
-------------------------------------------------------------------------


**********************************************************************
4D Plugins hosted by 4D, Inc.                      http://www.4D.com/


    Did you know?  The 4D Partner Program now gives you
    access to Hotfix releases as soon as they are available!
    To learn more, go to http://www.4D.com/support/partner.html

To Unsubscribe:                      mailto:4D-Plugins-off@...
***********************************************************************


Re: Major bug in plugin API for 11.2?

by Jeffrey Kain :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 7/23/08 9:31 PM, "Matthias Schmidt" <4D_info@...> wrote:

> don't you think this thread is more for the iNug as both plugins are
> still using the old API.

Well, it seems like a bug in how plug-ins interface to 4D v11. I'm happy to
post it wherever as long as it gets fixed... :)


**********************************************************************
4D Plugins hosted by 4D, Inc.                      http://www.4D.com/     
   

    Did you know?  The 4D Partner Program now gives you
    access to Hotfix releases as soon as they are available!
    To learn more, go to http://www.4D.com/support/partner.html

To Unsubscribe:                      mailto:4D-Plugins-off@...
***********************************************************************


RE: Major bug in plugin API for 11.2?

by Patrick de Boer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

In my experience it's best to avoid using $1, $2, $3 in plugin calls, not sure what 4D internally does with these variables but they seem to be treated differently from normal local variables.

I've had problems myself when passing $1 as a C_TEXT() to a plugin in an older version of 4D (2004), changes to the text handle were not persisted after the call.

On a side node, I find it good practise to assign the $1, $2, $3, ... parameters to local named variables at the start of a method. (with the exception of very small methods).

Upgrading to 4D v11 is not trival at all, I can tell you that lol.

Regards,
Patrick.



-----Original Message-----
From: 4D-Plugins@... [mailto:4D-Plugins@...] On Behalf Of Jeffrey Kain
Sent: woensdag 23 juli 2008 23:17
To: 4D Plugin Talk
Subject: Major bug in plugin API for 11.2?

We're seeing a lot of old, tested plug-in code fail in 4D v11.2 when we
pass a dereferenced pointer parameter into a plug-in.

Stuff like:

  OT GetArray (...; $1->)   ` ObjectTools

Or

  AL_GetSelect (...; $1->) ` AreaList Pro

If we change the code to something like:

  $ptr:=$1
  Plugin_call (... ; $ptr->)
 
... it works fine.

At first we thought it was just ObjectTools, but now we're noticing it
in AreaList Pro as well. This is causing a bit of a problem for
backwards compatibility.

Jeff


**********************************************************************
4D Plugins hosted by 4D, Inc.                      http://www.4D.com/     
   

    Did you know?  The 4D Partner Program now gives you
    access to Hotfix releases as soon as they are available!
    To learn more, go to http://www.4D.com/support/partner.html

To Unsubscribe:                      mailto:4D-Plugins-off@...
***********************************************************************

**********************************************************************
4D Plugins hosted by 4D, Inc.                      http://www.4D.com/


    Did you know?  The 4D Partner Program now gives you
    access to Hotfix releases as soon as they are available!
    To learn more, go to http://www.4D.com/support/partner.html

To Unsubscribe:                      mailto:4D-Plugins-off@...
***********************************************************************

LightInTheBox - Buy quality products at wholesale price