Parse error when creating menu item layout in Joomla 3 - joomla

Specifically, the chapter is about creating a new menu layout and the example uses the registration form. Whenever I try to create a new menu item with the alternate registration form through the admin, I get the following error:
Warning: simplexml_load_file(): file:///C:/xampp/.../com_users/registration/approval.xml:23: parser error : error parsing attribute name in C:\xampp...\menutypes.php on line 395
I get this error and a few other similar ones, they all seem to blow up on line 395 of the mentioned file. That line is:
if ($xml = simplexml_load_file($file))
how can I fix this? Thanks!!

My wild guess is that you should be using a comparison operator instead of an assignment operator:
if ($xml == simplexml_load_file($file))

Related

Cypress test passes single form input field but ignores the following one(s)

I’m trying to test a Stripe form with 3 input fields in Cypress. I found an example that works to test a single input that takes all the payment info (https://medium.com/#chipomapondera/hi-michael-98e432948028).
My version passes on inputting the CC but fails on the next input(s). My code is below:
it('checks user can support the Creator', () => {
cy.get('button[class="buttons__FollowButton-sc-10ti9z2-0 huoUmA"]').click()
cy.wait(4000)
cy.get('body')
.should('contain', 'Join this community')
cy.get('button[class="styledComponents__SubscribeButton-g42pit-3 kUgWbq"]').click()
cy.getWithinIframe('[name="cardnumber"]').type('4242424242424242')
.getWithinIframe('[name="exp-date"]').type('1232')
.getWithinIframe('[name="cvc"]').type('987')
})
It doesn’t seem to like the following after it has typed the card number:
cy.getWithinIframe(‘[name=”exp-date”]’).type(‘1232’)
cy.getWithinIframe(‘[name=”cvc”]’).type(‘987’)
The error I receive is:
cypress error
I could see a typo in the type field where there are no ending single quotes at this line of test .getWithinIframe('[name="exp-date"]').type('1232). Could you please try following .getWithinIframe('[name="exp-date"]').type('1232') or may be try without quotes .getWithinIframe('[name="exp-date"]').type(1232)
I followed the medium article you shared and ran into the same issue as you. The cause of this problem is of course that stripe is creating multiple iframes and the method created in the article is just getting the first iframe.
So a very simple solution is to pass the id of the div containing the iframe to our getWithinIframe function. The function will now look like this:
Cypress.Commands.add('getWithinIframe', (iframeSelector, targetElement) =>
cy.get(`#${iframeSelector} iframe`).iframeLoaded().its('document').getInDocument(targetElement));
And call it like so:
cy.getWithinIframe('cardNumberElement','[name="cardnumber"]').type(1212123);
Hope this helps anybody who is facing the same issues.

Error: Unknown slot type 'LIST_OF_COLORS' for slot 'Color'

Hi while following the tutorial: https://developer.amazon.com/de/alexa-skills-kit/alexa-skill-quick-start-tutorial
for building Alexa Skills I run into the following exception:
Error: There was a problem with your request: Unknown slot type 'LIST_OF_COLORS' for slot 'Color'
The error message does not state whether or not it was not able to parse the provided LIST_OF_COLORS definition of if something else went wrong.
Is this a Amazon Alaxa bug or did I miss something there?
I got this error because I didn't actually create the custom type - I needed to click both the Add and the Add Slot Type button.
Step 1: Create your type and values.
Step 2: Commit your changes.
Found a solution:
The Add Button, from Custom Slot Types, did not work the first time I hit it, I tried it again, and the list changed into:
From there on, it has worked as described

Joomla - Fatal error: Class 'JParameter' not found

I'm trying to upgrade Joomla 2.5.22 to 3.5.1, and last time I checked the progress bar, it was 86 %. I looked away for a moment and when I came back to check I saw the below error message.
Fatal error: Class 'JParameter' not found in
/home/mywebsite/public_html/plugins/system/bigshotgoogleanalytics/bigshotgoogleanalytics.php on line 24
What is the cause of this error and how would it be fixed?
Joomla can't find JParameter Class, so you have to use
jimport( 'joomla.html.parameter' );
before using JParameter class
bigshotanalytics is one of those plugins that cause a blank page or, at best, a fatal error when updating Joomla. This is because of its old code. I suggest you move the tracking code to your template. You can also add the tracking code to a custom HTML module (after removing the encapsulating div through an override) and then assign the module to a position in your template (the position should be in the section of the HTML).
Now to answer your question, Joomla no longer uses JParameter - it uses JRegistry instead. So something like:
$jparameter = new JParameter('param1');
Should be changed to:
$jregistry= new JRegistry();
$jparameter = $jregistry->get('param1');

Joomla 3.0 and modules.php: static variable(2d) and caching - output error

I have the following problem:
I use Joomla 3.0.1 and my own developed Template(with bootstrap). When I turn the normal Joomla caching to on, my site has output errors. These errors are regarding to the modules.php from my template, because I use a static variable(array) to save all loaded module positions and the calulated or preseted spans for bootstrap in an 2 dimensional array. Like this:
top ->2,4,6
left ->3,3,3,3
right ->4,4,4
bottom ->1,2,3,4,2
header ->12
footer ->6,6
Without caching it works perfect, but when i turn it on, i have following errors:
Notice: Undefined index: logo in
/root/templates/jooag_workframe30/html/modules.php on line 82
Notice: Undefined index: mainmenu in
/root/templates/jooag_workframe30/html/modules.php on line 72
I know what this means and where to look, but i have no solution to fix this.
The modules.php code is here:
http://pastebin.com/s4tjXcKR
The entire template is here:
http://www.mediafire.com/?qrkbatdcbs4iq2v
If a position doesn't contain any modules (ie $modCount = 0) the $spanMatrix array won't have its key, so you should be checking whether it exists before trying to access it
I suggest you wrap lines 72-75 AND line 82 of your modules.php in the following statement:
if( isset( $spanMatrix[$modPosition] ))
{
.....
}
Let me know if it works

when using remapColumns in different event, sort icon doesn't show when clicking a header

I saved my column permutation info into a table. This information can be reloaded in beforeRequest event:
mynewperm = {....};
myGrid.jqGrid("remapColumns", mynewperm, true);
The columns are reordered correctly. However I lost the header icon. Now if I click any column header, I can not see
the sort icon anymore, then can not sort any column. How can I get it back?
Thank you,
yh
if you are able to change the code, you could test for an undefined of a.grid.headers[a.p.lastsort].
In the source file it could look like this:
// old
var previousSelectedTh = ts.grid.headers[ts.p.lastsort].el
// new:
var previousSelectedTh = ts.grid.headers[ts.p.lastsort] ? ts.grid.headers[ts.p.lastsort].el : null
Indeed if you look at the jquery.jqGrid.src.js source, the line is:
var previousSelectedTh = ts.grid.headers[ts.p.lastsort].el, newSelectedTh = ts.grid.headers[idxcol].el;
Line #1982 in my version. I fixed it by modifying the file and added this just before that line:
if (ts.p.lastsort < 0) // johnl.
ts.p.lastsort = 0;
The problem was that ts.p.lastsort was -1.
I've just managed to fix this issue myself but not using the methods described above. I was receiving the following error message when trying to sort columns in a jqgrid:
TypeError: a.grid.headers[a.p.lastsort] is undefined js/jqgrid/jquery.jqGrid.min.js?1.4:86
I should note that it was Firebug that produced this error message. Our company develops web applications for Chrome but Chrome's Javascript console produced a very uninformative error message:
Uncaught TypeError: Cannot read property 'el' of undefined
After stripping out all but the jqGrid declaration on the page causing the issue, it transpired that removing the "multiSelect" option declaration for the jqGrid solved the issue. Apparently, declaring this option causes an additional hidden column to be added into the grid rendered which enables users to select multiple grid rows at a time. I'm not exactly sure why this caused an issue but after consultation with the programming director here our best guess is that there is a for loop somewhere in the jqGrid library code which is called when column sorting is applied and the loop is not taking into account this extra column which results in it not being defined.
Strange answer to a strange issue but hopefully this will help somebody out in future and save them around 3 hours of debugging!
I've the same issue :
It append to me since i apply the "remapColumns" method in the "loadComplete" event (i get back user column configuration from a cookie).
So when I try to sort a column nothing happen. I got this error in firebug :
a.grid.headers[a.p.lastsort] is undefined -> jquery.jqGrid.min.js (line 93)
maybe it will be helpful to find what the problem is
Thank you

Resources