Giter Club home page Giter Club logo

Comments (8)

eddieajau avatar eddieajau commented on May 14, 2024

Actually I didn't ask, was just pointing out an issue that wasn't relevant to the platform. For what it's worth, it's very easy to reconfigure a module to use jview. There is no need to relocate anything, just use the published API that exists already.

from joomla-cms.

AmyStephen avatar AmyStephen commented on May 14, 2024

For clarification, Andrew's comment that prompted my issue report joomla/joomla-platform#769 (comment)

@eddieajau - how can JView be used with a module? When I attempt to use the method statically, I get this error:

Fatal error: Using $this when not in object context in /Users/amystephen/Sites/joomla-cms/libraries/joomla/application/component/view.php on line 441

Fatal error: Access to undeclared static property: JLoader::$classes in /Users/amystephen/Sites/joomla-cms/libraries/loader.php on line 189

How do you recommend this be done?

from joomla-cms.

eddieajau avatar eddieajau commented on May 14, 2024

@AmyStephen the error you are seeing is telling you that you are using a method statically that was never designed to be used statically. Both the Platform and CMS are now PHP 5 so unless a method is declared statically, you should not use it that way (in Eclipse, the code-assist will only show methods explicitly declared static when used in that context). An example of how you can use JView in a module can be found here:

https://github.com/eddieajau/joomla-hello-world/blob/master/modules/mod_hello/mod_hello.php

[ if you sign up for my training I'll explain why :) ]

In practice you wouldn't include the class in the module file but in it's own file and then use a require_once statement or, better, register the class with JLoader::register. It's a bit rough but it gets the job done. As I explain in my training, the major advantage in doing it this way is that you design layouts for components and modules in the same way so you get the escape method and also cool things like $this->baseurl, etc. There are some Easter eggs in the layout of that example module as well, but I'll leave you to find them :)

As for a recommendation, I'm agnostic about whether you use JView or just apply a quick fix with htmlspecialchars. Either will work.

from joomla-cms.

AmyStephen avatar AmyStephen commented on May 14, 2024

The problem exists in 1.5 as well as 2.5. I hope it's fixed before release. It's an important issue.

from joomla-cms.

eddieajau avatar eddieajau commented on May 14, 2024

Talk to the JBS about how they want to handle it.

from joomla-cms.

AmyStephen avatar AmyStephen commented on May 14, 2024

@eddieajau - This is an issue report for the JBS. I have reported the problem. I am certain they will handle this appropriately. If you wish to talk to me further, please use email.

from joomla-cms.

eddieajau avatar eddieajau commented on May 14, 2024

They will probably want you to raise the issue on the JoomlaCode tracker.

from joomla-cms.

brianteeman avatar brianteeman commented on May 14, 2024

Thanks for reporting this. At this time we are only using github as the place to submit code fixes so I am closing the report here. The actual reporting of issues and testing fixes is still taking place on Joomlacode.

As it has been some time since you opened this issue can you please confirm that it is still valid with the current Master or Joomla 3.2 beta.

If it is still valid please can you open an item on the Joomlacode tracker in the appropriate area.

CMS Bug Reports: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemBrowse&tracker_id=8103

CMS Feature Requests: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemBrowse&tracker_id=8549

from joomla-cms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.