Welcome, Guest
Username: Password: Remember me

TOPIC: Converting to Joomla 3.0

Converting to Joomla 3.0 04 Dec 2012 10:45 #5804

  • elliotcater
  • elliotcater's Avatar
  • Offline
  • New Member
  • Posts: 12
  • Thank you received: 1
  • Karma: 0
Hi,

I've just about finished cooking and have taken the component creator as far as I need - it's time to get my hands dirty!

Now most of the stuff I'm doing is on Joomla 3.0 so I've used the resource below and picked through the code to replace stuff:

http://docs.joomla.org/Potential_backward_compatibility_issues_in_Joomla_3.0_and_Joomla_Platform_12.1

Now my component installs fine and looks ok in the grid view but when I try to create a new record it fails. On clicking the "New" button it tries to take me to the item layout but it's just a blank. I've no idea about how to troubleshoot this - it seems my component is pretty close to being Joomla 3.0 compatible and I'm on the home straight.

Hope someone can help me, I've searched using the search function here and googled all over and I'm not quite sure how to go forward.

All the best

Elliot

edit:

There are certain things on the backwards compatibility document that are "deprecated", I assume these are still ok being used and won't break the component? (JRequest::getCmd & JRequest::getVar etc...)
edit no.2!

I've tried changing the deprecated stuff to use JFactory::getApplication()->input instead but I'm still having no luck...
Last Edit: 04 Dec 2012 14:47 by elliotcater.
The administrator has disabled public write access.

Re: Converting to Joomla 3.0 04 Dec 2012 19:55 #5816

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
  • Karma: 64
Hi,

I'm not 100% sure on the when and exact details of what however, I do now that the intention is that Cook version 2.0 will be joomla 2.5/3.0 compatible.

Sorry I can't be more specific. Admin will keep us as up-to-date as possible on the board so keep your ear to the ground!

Best of luck,

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
The administrator has disabled public write access.

Re: Converting to Joomla 3.0 05 Dec 2012 09:45 #5828

  • elliotcater
  • elliotcater's Avatar
  • Offline
  • New Member
  • Posts: 12
  • Thank you received: 1
  • Karma: 0
Cheers again Gez,

I'm in the process of doing find and replace. Incase anyone's reading this here's a list of my find and replaces:

.DS. > .DIRECTORY_SEPARATOR.
JModel\n > JModelLegacy\n
JModel:: > JModelLegacy::
JController\n > JControllerLegacy\n
JView\n > JViewLegacy\n
JFile::read > file_get_contents
JRequest::getCmd > JFactory::getApplication()->input->get
JRequest::getVar > JFactory::getApplication()->input->get
JRequest::checkToken > JSession::checkToken
JURI > JUri
JHTML:: > JHtml::
JUtility::getToken > JSession::getFormToken
onclick="checkAll > onclick="Joomla.checkAll

I basically worked my way through the Potential Backwards Compatiblity document and these are the bits that applied to my component - other folks mileage may vary of course!

Everything is working now and all views of the component are accessible - however in the edit views my "Cancel", "Save and Cancel" and "sidebar-nav" menu don't work and any radio buttons in the form have stacked on top of each other?!

and when I set the Error Reporting to "Development" it shows me lots of Strict Standards warnings - some saying "Non-static method XXXXX should not be called statically in /XXXXXX/XXXXX/XXXX..." or "Only variables should be assigned by reference in XXXXX" and "Declaration of XXXXXXControllerXXXXXXX::display() should be compatible with JControllerLegacy::display($cachable = false, $urlparams = Array) in /XXXX/XXXX/..."

Now the "only variables should be assigned by reference..." warnings are generated because in some files JFactory is preceded by an ampersand (i.e. &JFactory). From what I can gather, the ampersand before the function is a throwback to pre php 5 that declares that the method (or function) returns a reference - now this happens automatically in php 5+ apparently...

I am assuming now that these Strict Standards errors are benign as there is no "Fatal" errors and the fact my "sidenav-bar" and Cancel/Save&Cancel buttons aren't working is down to something else (Javascript maybe?). I'm edging closer now if anyone has any advice on how to go about troubleshooting the buttons I'd be very gratefull :)

All the best

Elliot

edit:

I'm getting errors in my browsers Inspector relating to this line:
jQuery("#adminForm").validationEngine();

Type Issue
'undefined' is not a function (evaluating 'jQuery("#adminForm").validationEngine()')

and crucially (I think?!) I'm getting a:
Reference Issue
Can't find variable: jQuery

Looking at the script declarations in the header of the page it shows jquery.validationEngine.js being loaded before the actual jQuery script!

I'm going to try making the validationEngine load AFTER jQuery and report back...

;)

edit 2:

Ok so in the admin side helper.php, in the headerDeclerations function I've commented out the line:

$doc->addScript($componentUrlAdmin . '/js/jquery.validationEngine.js');

and now I'm manually echoing it in the tmpl and my buttons are working!!!!!

This seems like a bit of a hack at best - can anyone suggest a better way around declaring the validationEngine.js after Joomla's main jquery.js declaration?

I feel slightly victorious, so I'm going to celebrate by moving on to the next step of messing around with the front end views. No rest for the wicked... :evil:
Last Edit: 05 Dec 2012 10:34 by elliotcater.
The administrator has disabled public write access.

Re: Converting to Joomla 3.0 05 Dec 2012 11:43 #5833

  • elliotcater
  • elliotcater's Avatar
  • Offline
  • New Member
  • Posts: 12
  • Thank you received: 1
  • Karma: 0
Ok...

Rather than keeping adding edits to my post I'm replying! LOL

It appears the admin views are a lacking formatting and images on buttons (like "publised_r" etc...). I'm guessing that's because J-Cook uses JDom to create the view and Joomla now uses the bootstrap, another user felichon seems to have expressed this here:

French Speaking Link

English Speaking Link

The component works but just doesn't look great - I'm guessing this will be a real pig to change as it probably involves messing with the JDom stuff. To be honest I haven't got a clue where to begin with this! I don't even have a clue how to "remove" the JDom from the component so it can just use the Joomla standard way of layout...

:unsure:
The administrator has disabled public write access.
Time to create page: 0.072 seconds

Get Started