Ticket #522 (closed bug: fixed)

Opened 8 months ago

Last modified 8 months ago

jSelectorInterface not compatible with jSelectorFactory

Reported by: doubleface Assigned to: doubleface
Priority: normal Milestone: Jelix 1.0.3
Component: jelix:core Version: 1.0.2
Severity: minor Keywords:
Cc: Php version:
Review: review+ Hosting Provider:
Documentation needed: 0 Blocking:

Description

The following code does not work :

    $s = new jSelectorInterface('test');
    $long_selector = $s->toString(true);
    $s2 = jSelectorFactory::create($long_selector);

Because here, $long_selector equals "iface:modulename~test" and then jSelectorFactory tries to create a jSelectoriface instead of a jSelectorInterface.

I see 2 solutions :

  • Rename jSelectorInterface to jSelectorIface but this may cause a problem to those who already use jSelectorInterface directly (without jClass::incIface), maybe not many people after all.
  • Change regexp of jSelectorFactory from "/^([a-z]{3,5})\:([\w~\/\.]+)$/" to "/^([a-z]{3,9})\:([\w~\/\.]+)$/" and change jSelectorInterface::type to "interface"

But maybe I don't see all impacts of such modifications... Your choice.

Attachments

jSelectorInterface.patch (1.7 kB) - added by doubleface on 03/23/08 16:48:43.

Change History

03/21/08 21:12:24 changed by laurentj

  • component changed from jelix to jelix:core.
  • milestone set to Jelix 1.1.

Oups, I think I made a mistake :-)

The best solution I think is to change the class name to jSelectorIface, and to recreate jSelectorInterface which just inherits from jSelectorIface, and to mark it as @deprecated. Then this class will be removed in 1.2 or later.

03/23/08 16:48:06 changed by doubleface

  • review set to review?.

Here is the corresponding patch

03/23/08 16:48:43 changed by doubleface

  • attachment jSelectorInterface.patch added.

03/23/08 21:43:24 changed by doubleface

  • status changed from new to assigned.
  • owner changed from laurentj to doubleface.

03/24/08 16:12:30 changed by laurentj

  • review changed from review? to review+.
  • milestone changed from Jelix 1.1 to Jelix 1.0.3.

It's ok. Just replace "@since 1.0b2" by "@since 1.0.3" in the comment of jSelectorIface ;-)

You can land this patch into the 1.0.x branch and the trunk.

Thanks for this patch.

03/24/08 22:24:25 changed by doubleface

  • status changed from assigned to closed.
  • resolution set to fixed.
Download in other formats: Comma-delimited Text Tab-delimited Text RSS Feed