Comments (8)
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.
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.
@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.
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.
Talk to the JBS about how they want to handle it.
from joomla-cms.
@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.
They will probably want you to raise the issue on the JoomlaCode tracker.
from joomla-cms.
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)
- Cassiopeia not compatible with safari HOT 4
- spam
- [5.0.2][System - SEF] does not work correctly for rel="canonical" HOT 3
- Missing user in article version list HOT 3
- Media Manager empty HOT 11
- All Menu Items => Select Menu do not works HOT 3
- Umlauts in menus are not rewritten HOT 4
- Joomla\Filesystem\Path: Fix incorrect non-empty path check HOT 1
- [5.0] Menu page header and Article header style HOT 2
- [4.xxx] {5.xx] plugin> content ->fields prepare fulltext missing HOT 3
- Fr_CA language package has incorrect localise classname HOT 2
- [5.0] Email cloaking is not working HOT 9
- Menu Item "Save as Copy" bug - create something with Menu Item Alias functionality instead of HOT 5
- "Overrides to check" - for non Developers HOT 11
- Password being send with new user mail despite "user" option "send password" being "no" HOT 7
- Tag language error on multilingual sites HOT 7
- Add ability to minimise Accessibility Options icon. HOT 1
- spam
- X-Frame-Options deny but same site?
- Facebook Links HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from joomla-cms.