is not used any more and exists only for history. Post new tickets on the Github account. n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Opened 14 years ago

Closed 13 years ago

#522 closed bug (fixed)

jSelectorInterface not compatible with jSelectorFactory

Reported by: doubleface Owned by: doubleface
Priority: normal Milestone: Jelix 1.0.3
Component: jelix:core Version: 1.0.2
Severity: minor Keywords:
Cc: Blocked By:
Blocking: Documentation needed: no
Hosting Provider: Php version:


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 (1)

jSelectorInterface.patch (1.7 KB) - added by doubleface 13 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 14 years ago 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.

comment:2 Changed 13 years ago by doubleface

  • review set to review?

Here is the corresponding patch

Changed 13 years ago by doubleface

comment:3 Changed 13 years ago by doubleface

  • Owner changed from laurentj to doubleface
  • Status changed from new to assigned

comment:4 Changed 13 years ago by laurentj

  • Milestone changed from Jelix 1.1 to Jelix 1.0.3
  • review changed from review? to review+

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.

comment:5 Changed 13 years ago by doubleface

  • Resolution set to fixed
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.