How to stop Joomla 2.5 from disabling PHPHow to edit user activation mail body in Joomla 2.5?Sublime Text 3: Joomla coding standard (PHP Code Sniffer) is not executedRun custom php script in Joomla siteHow to implement this php code?Transform PHP SQL to Joomla SQL queryUpgraded from 2.5 to 3.5 : Joomla.JMultiSelect, Class is not definedAdding a stand alone php (with sql queries built using mysql phpgenerator) to existing Joomla applicationResults of gdb on core dump from Joomla Installation - meaning?How to manage sessions between Joomla and external PHP applications?Joomla registration emails and PHP mail() taking hours to deliver
Why am I getting a strange double quote (“) in Open Office instead of the ordinary one (")?
What is the color of artificial intelligence?
Increase speed altering column on large table to NON NULL
Do people with slow metabolism tend to gain weight (fat) if they stop exercising?
Non-aqueous eyes?
Do you have to have figures when playing D&D?
Who voices the small round football sized demon In Good Omens
Fermat's statement about the ancients: How serious was he?
Does putting salt first make it easier for attacker to bruteforce the hash?
Can I utilise a baking stone to make crepes?
Proving that a Russian cryptographic standard is too structured
Does the new finding on "reversing a quantum jump mid-flight" rule out any interpretations of QM?
Section numbering in binary
How to avoid typing 'git' at the begining of every Git command
Why was this person allowed to become Grand Maester?
How do i export activities related to an account with a specific recordtype?
Electricity free spaceship
Teaching a class likely meant to inflate the GPA of student athletes
What STL algorithm can determine if exactly one item in a container satisfies a predicate?
Who won a Game of Bar Dice?
A word that means "blending into a community too much"
Is using 'echo' to display attacker-controlled data on the terminal dangerous?
Sql Server delete syntax
Why Does Mama Coco Look Old After Going to the Other World?
How to stop Joomla 2.5 from disabling PHP
How to edit user activation mail body in Joomla 2.5?Sublime Text 3: Joomla coding standard (PHP Code Sniffer) is not executedRun custom php script in Joomla siteHow to implement this php code?Transform PHP SQL to Joomla SQL queryUpgraded from 2.5 to 3.5 : Joomla.JMultiSelect, Class is not definedAdding a stand alone php (with sql queries built using mysql phpgenerator) to existing Joomla applicationResults of gdb on core dump from Joomla Installation - meaning?How to manage sessions between Joomla and external PHP applications?Joomla registration emails and PHP mail() taking hours to deliver
I need to stop Joomla from converting PHP code to a comment (or otherwise disabling it).
I copied a working page with a basic [directory listing] function, and the duplicate wouldn't work.
I am nearly positive Joomla is "intelligently" modifying the PHP to disable it--how can I stop this?
X/Y Problem:
A working extension to list directory contents would sidestep this issue, because that's really what I need--though I'd prefer to also learn what I'm doing wrong.
TL;DR
I periodically provide updates for a site (Joomla 2.5) I neither own nor host. I've recommended we update or rebuild it, so far a non-option.
I don't really know much PHP. However the below code polls a given directory and links the files. The customer has backend access and can quickly distribute information via this page, uploading PDF files as required and removing the obsolete ones. Simple for the customer and works great.
Yesterday she requested a new page for a different category of information.
I created a separate directory for the new page (Turnover) and updated the copied code to reflect this. The original page (Output) worked fine, but the duplicate page was blank except for title. I took a step back but not even the unmodified copy would work on the new page--though it still worked on the old.
Before realizing the PHP was not even being executed, I verified that
- The articles are identical except by title and index number
- Permissions on the new directory match the original AFAICT
- It's not file, filename, or size (new file immediately worked in the old directory)
- Also created a second duplicate page to rule out human error
Since one page works and another doesn't, it's clearly not an incompatibility between Joomla and PHP versions, and most likely not a server misconfiguration.
The page source on the broken page show the PHP as a comment; the working page served working links:
file1
file2
file3
After extended troubleshooting, I altered only the title of the original page--and it subsequently failed. I now have two pages that won't work, meaning the customer will need to upload files and then wait until I can log in and manually create individual links. Then she'll wait again when I remove old ones.
I don't have shell access, nor to backups, if they even exist. I learned last night that Joomla lacks a revision history. I normally use Wordpress, and this hasn't convinced me to switch. :,/
I suspect the issue is with Joomla and not the code itself. Code examples I've seen begin with <?php
(and not <!--?php
), but my assumption that this is the sole issue could be wrong. When I manually remove those three characters, the code is simply converted to text as part of the page.
The code below is exactly how I first saw it in the HTML editor (without the HTML editor I don't even see the PHP at all). Joomla adds the paragraph tags automatically and converts <b> tags to <strong>.
(I checked page source of both pages before and after I broke the original page).
<p><strong>Output</strong></p>
<!--?php
//path to directory to scan
$directory = "images/download/output/";
$files = glob($directory . "*.pdf");
array_multisort(array_map( 'filemtime', $files ),SORT_NUMERIC,SORT_DESC,$files);
//print each file name
foreach($files as $f)
$path_parts = pathinfo($f);
echo '<p><a href="'.$f.'">'.$path_parts['filename'].'</a></p>';
?-->
<p> </p>
(thanks to the mod who migrated for me--I should've checked to see if there was a Joomla stack)
With a busy weekend already underway, fixing this is pretty important--thanks for any help/advice offered. I figured this should take fifteen or twenty minutes--but I've burned hours on it.
php joomla-2.5 editor
migrated from serverfault.com May 25 at 22:03
This question came from our site for system and network administrators.
add a comment |
I need to stop Joomla from converting PHP code to a comment (or otherwise disabling it).
I copied a working page with a basic [directory listing] function, and the duplicate wouldn't work.
I am nearly positive Joomla is "intelligently" modifying the PHP to disable it--how can I stop this?
X/Y Problem:
A working extension to list directory contents would sidestep this issue, because that's really what I need--though I'd prefer to also learn what I'm doing wrong.
TL;DR
I periodically provide updates for a site (Joomla 2.5) I neither own nor host. I've recommended we update or rebuild it, so far a non-option.
I don't really know much PHP. However the below code polls a given directory and links the files. The customer has backend access and can quickly distribute information via this page, uploading PDF files as required and removing the obsolete ones. Simple for the customer and works great.
Yesterday she requested a new page for a different category of information.
I created a separate directory for the new page (Turnover) and updated the copied code to reflect this. The original page (Output) worked fine, but the duplicate page was blank except for title. I took a step back but not even the unmodified copy would work on the new page--though it still worked on the old.
Before realizing the PHP was not even being executed, I verified that
- The articles are identical except by title and index number
- Permissions on the new directory match the original AFAICT
- It's not file, filename, or size (new file immediately worked in the old directory)
- Also created a second duplicate page to rule out human error
Since one page works and another doesn't, it's clearly not an incompatibility between Joomla and PHP versions, and most likely not a server misconfiguration.
The page source on the broken page show the PHP as a comment; the working page served working links:
file1
file2
file3
After extended troubleshooting, I altered only the title of the original page--and it subsequently failed. I now have two pages that won't work, meaning the customer will need to upload files and then wait until I can log in and manually create individual links. Then she'll wait again when I remove old ones.
I don't have shell access, nor to backups, if they even exist. I learned last night that Joomla lacks a revision history. I normally use Wordpress, and this hasn't convinced me to switch. :,/
I suspect the issue is with Joomla and not the code itself. Code examples I've seen begin with <?php
(and not <!--?php
), but my assumption that this is the sole issue could be wrong. When I manually remove those three characters, the code is simply converted to text as part of the page.
The code below is exactly how I first saw it in the HTML editor (without the HTML editor I don't even see the PHP at all). Joomla adds the paragraph tags automatically and converts <b> tags to <strong>.
(I checked page source of both pages before and after I broke the original page).
<p><strong>Output</strong></p>
<!--?php
//path to directory to scan
$directory = "images/download/output/";
$files = glob($directory . "*.pdf");
array_multisort(array_map( 'filemtime', $files ),SORT_NUMERIC,SORT_DESC,$files);
//print each file name
foreach($files as $f)
$path_parts = pathinfo($f);
echo '<p><a href="'.$f.'">'.$path_parts['filename'].'</a></p>';
?-->
<p> </p>
(thanks to the mod who migrated for me--I should've checked to see if there was a Joomla stack)
With a busy weekend already underway, fixing this is pretty important--thanks for any help/advice offered. I figured this should take fifteen or twenty minutes--but I've burned hours on it.
php joomla-2.5 editor
migrated from serverfault.com May 25 at 22:03
This question came from our site for system and network administrators.
1
I can't accept my own answer yet, but I plan to (can't for two days). I didn't realize there's an editor choice in the Joomla UI.
– zedmelon
May 25 at 22:19
1
Good comprehensive posts @zedmelon I love to see question which show exhaustive investigation and toil (I wish all posted questions were this way). Please continue to post your Joomla questions in this community. Please take the tour.
– mickmackusa
May 25 at 22:56
Yes, great to see such an exhaustive and well documented question.
– Neil Robertson
May 27 at 0:16
Thank you gentlemen. It's nice when my tendency to talk (way) too much actually proves useful :,)
– zedmelon
May 27 at 18:21
On a more serious note, I do try to (a) fix stuff on my own (b) research before requesting help, and (c) remember that others are helping me out of benevolence, and making it easier for them not only (1) gets it done sooner, but (2) is respectful, which is non-negotiable.
– zedmelon
May 27 at 18:38
add a comment |
I need to stop Joomla from converting PHP code to a comment (or otherwise disabling it).
I copied a working page with a basic [directory listing] function, and the duplicate wouldn't work.
I am nearly positive Joomla is "intelligently" modifying the PHP to disable it--how can I stop this?
X/Y Problem:
A working extension to list directory contents would sidestep this issue, because that's really what I need--though I'd prefer to also learn what I'm doing wrong.
TL;DR
I periodically provide updates for a site (Joomla 2.5) I neither own nor host. I've recommended we update or rebuild it, so far a non-option.
I don't really know much PHP. However the below code polls a given directory and links the files. The customer has backend access and can quickly distribute information via this page, uploading PDF files as required and removing the obsolete ones. Simple for the customer and works great.
Yesterday she requested a new page for a different category of information.
I created a separate directory for the new page (Turnover) and updated the copied code to reflect this. The original page (Output) worked fine, but the duplicate page was blank except for title. I took a step back but not even the unmodified copy would work on the new page--though it still worked on the old.
Before realizing the PHP was not even being executed, I verified that
- The articles are identical except by title and index number
- Permissions on the new directory match the original AFAICT
- It's not file, filename, or size (new file immediately worked in the old directory)
- Also created a second duplicate page to rule out human error
Since one page works and another doesn't, it's clearly not an incompatibility between Joomla and PHP versions, and most likely not a server misconfiguration.
The page source on the broken page show the PHP as a comment; the working page served working links:
file1
file2
file3
After extended troubleshooting, I altered only the title of the original page--and it subsequently failed. I now have two pages that won't work, meaning the customer will need to upload files and then wait until I can log in and manually create individual links. Then she'll wait again when I remove old ones.
I don't have shell access, nor to backups, if they even exist. I learned last night that Joomla lacks a revision history. I normally use Wordpress, and this hasn't convinced me to switch. :,/
I suspect the issue is with Joomla and not the code itself. Code examples I've seen begin with <?php
(and not <!--?php
), but my assumption that this is the sole issue could be wrong. When I manually remove those three characters, the code is simply converted to text as part of the page.
The code below is exactly how I first saw it in the HTML editor (without the HTML editor I don't even see the PHP at all). Joomla adds the paragraph tags automatically and converts <b> tags to <strong>.
(I checked page source of both pages before and after I broke the original page).
<p><strong>Output</strong></p>
<!--?php
//path to directory to scan
$directory = "images/download/output/";
$files = glob($directory . "*.pdf");
array_multisort(array_map( 'filemtime', $files ),SORT_NUMERIC,SORT_DESC,$files);
//print each file name
foreach($files as $f)
$path_parts = pathinfo($f);
echo '<p><a href="'.$f.'">'.$path_parts['filename'].'</a></p>';
?-->
<p> </p>
(thanks to the mod who migrated for me--I should've checked to see if there was a Joomla stack)
With a busy weekend already underway, fixing this is pretty important--thanks for any help/advice offered. I figured this should take fifteen or twenty minutes--but I've burned hours on it.
php joomla-2.5 editor
I need to stop Joomla from converting PHP code to a comment (or otherwise disabling it).
I copied a working page with a basic [directory listing] function, and the duplicate wouldn't work.
I am nearly positive Joomla is "intelligently" modifying the PHP to disable it--how can I stop this?
X/Y Problem:
A working extension to list directory contents would sidestep this issue, because that's really what I need--though I'd prefer to also learn what I'm doing wrong.
TL;DR
I periodically provide updates for a site (Joomla 2.5) I neither own nor host. I've recommended we update or rebuild it, so far a non-option.
I don't really know much PHP. However the below code polls a given directory and links the files. The customer has backend access and can quickly distribute information via this page, uploading PDF files as required and removing the obsolete ones. Simple for the customer and works great.
Yesterday she requested a new page for a different category of information.
I created a separate directory for the new page (Turnover) and updated the copied code to reflect this. The original page (Output) worked fine, but the duplicate page was blank except for title. I took a step back but not even the unmodified copy would work on the new page--though it still worked on the old.
Before realizing the PHP was not even being executed, I verified that
- The articles are identical except by title and index number
- Permissions on the new directory match the original AFAICT
- It's not file, filename, or size (new file immediately worked in the old directory)
- Also created a second duplicate page to rule out human error
Since one page works and another doesn't, it's clearly not an incompatibility between Joomla and PHP versions, and most likely not a server misconfiguration.
The page source on the broken page show the PHP as a comment; the working page served working links:
file1
file2
file3
After extended troubleshooting, I altered only the title of the original page--and it subsequently failed. I now have two pages that won't work, meaning the customer will need to upload files and then wait until I can log in and manually create individual links. Then she'll wait again when I remove old ones.
I don't have shell access, nor to backups, if they even exist. I learned last night that Joomla lacks a revision history. I normally use Wordpress, and this hasn't convinced me to switch. :,/
I suspect the issue is with Joomla and not the code itself. Code examples I've seen begin with <?php
(and not <!--?php
), but my assumption that this is the sole issue could be wrong. When I manually remove those three characters, the code is simply converted to text as part of the page.
The code below is exactly how I first saw it in the HTML editor (without the HTML editor I don't even see the PHP at all). Joomla adds the paragraph tags automatically and converts <b> tags to <strong>.
(I checked page source of both pages before and after I broke the original page).
<p><strong>Output</strong></p>
<!--?php
//path to directory to scan
$directory = "images/download/output/";
$files = glob($directory . "*.pdf");
array_multisort(array_map( 'filemtime', $files ),SORT_NUMERIC,SORT_DESC,$files);
//print each file name
foreach($files as $f)
$path_parts = pathinfo($f);
echo '<p><a href="'.$f.'">'.$path_parts['filename'].'</a></p>';
?-->
<p> </p>
(thanks to the mod who migrated for me--I should've checked to see if there was a Joomla stack)
With a busy weekend already underway, fixing this is pretty important--thanks for any help/advice offered. I figured this should take fifteen or twenty minutes--but I've burned hours on it.
php joomla-2.5 editor
php joomla-2.5 editor
edited May 28 at 13:58
zedmelon
asked May 25 at 21:04
zedmelonzedmelon
418
418
migrated from serverfault.com May 25 at 22:03
This question came from our site for system and network administrators.
migrated from serverfault.com May 25 at 22:03
This question came from our site for system and network administrators.
1
I can't accept my own answer yet, but I plan to (can't for two days). I didn't realize there's an editor choice in the Joomla UI.
– zedmelon
May 25 at 22:19
1
Good comprehensive posts @zedmelon I love to see question which show exhaustive investigation and toil (I wish all posted questions were this way). Please continue to post your Joomla questions in this community. Please take the tour.
– mickmackusa
May 25 at 22:56
Yes, great to see such an exhaustive and well documented question.
– Neil Robertson
May 27 at 0:16
Thank you gentlemen. It's nice when my tendency to talk (way) too much actually proves useful :,)
– zedmelon
May 27 at 18:21
On a more serious note, I do try to (a) fix stuff on my own (b) research before requesting help, and (c) remember that others are helping me out of benevolence, and making it easier for them not only (1) gets it done sooner, but (2) is respectful, which is non-negotiable.
– zedmelon
May 27 at 18:38
add a comment |
1
I can't accept my own answer yet, but I plan to (can't for two days). I didn't realize there's an editor choice in the Joomla UI.
– zedmelon
May 25 at 22:19
1
Good comprehensive posts @zedmelon I love to see question which show exhaustive investigation and toil (I wish all posted questions were this way). Please continue to post your Joomla questions in this community. Please take the tour.
– mickmackusa
May 25 at 22:56
Yes, great to see such an exhaustive and well documented question.
– Neil Robertson
May 27 at 0:16
Thank you gentlemen. It's nice when my tendency to talk (way) too much actually proves useful :,)
– zedmelon
May 27 at 18:21
On a more serious note, I do try to (a) fix stuff on my own (b) research before requesting help, and (c) remember that others are helping me out of benevolence, and making it easier for them not only (1) gets it done sooner, but (2) is respectful, which is non-negotiable.
– zedmelon
May 27 at 18:38
1
1
I can't accept my own answer yet, but I plan to (can't for two days). I didn't realize there's an editor choice in the Joomla UI.
– zedmelon
May 25 at 22:19
I can't accept my own answer yet, but I plan to (can't for two days). I didn't realize there's an editor choice in the Joomla UI.
– zedmelon
May 25 at 22:19
1
1
Good comprehensive posts @zedmelon I love to see question which show exhaustive investigation and toil (I wish all posted questions were this way). Please continue to post your Joomla questions in this community. Please take the tour.
– mickmackusa
May 25 at 22:56
Good comprehensive posts @zedmelon I love to see question which show exhaustive investigation and toil (I wish all posted questions were this way). Please continue to post your Joomla questions in this community. Please take the tour.
– mickmackusa
May 25 at 22:56
Yes, great to see such an exhaustive and well documented question.
– Neil Robertson
May 27 at 0:16
Yes, great to see such an exhaustive and well documented question.
– Neil Robertson
May 27 at 0:16
Thank you gentlemen. It's nice when my tendency to talk (way) too much actually proves useful :,)
– zedmelon
May 27 at 18:21
Thank you gentlemen. It's nice when my tendency to talk (way) too much actually proves useful :,)
– zedmelon
May 27 at 18:21
On a more serious note, I do try to (a) fix stuff on my own (b) research before requesting help, and (c) remember that others are helping me out of benevolence, and making it easier for them not only (1) gets it done sooner, but (2) is respectful, which is non-negotiable.
– zedmelon
May 27 at 18:38
On a more serious note, I do try to (a) fix stuff on my own (b) research before requesting help, and (c) remember that others are helping me out of benevolence, and making it easier for them not only (1) gets it done sooner, but (2) is respectful, which is non-negotiable.
– zedmelon
May 27 at 18:38
add a comment |
2 Answers
2
active
oldest
votes
FIXED:
The culprit was a personal editor choice set in the user profile section.
I changed this to Editor - None
, resubmitted the disobedient code (without comment tags), and it worked like a charm!
Clearly the user who created the original article did not use the TinyMCE, but my account had that selected. I did not create the user account I'm using--though I suspect I wouldn't have noticed this anyway and would still likely have found myself in the same boat.
It's worth noting that TinyMCE was editing the code before I opened it, rather than as I was submitting/saving the post. The PHP was converted to a comment up front, and since I'm a PHP n00b it didn't stand out to me like it should've. I duplicated a comment I assumed was code, and I lacked the programming chops to recognize that.
I'm glad it was something simple, but holy smokes this had me barking up the wrong tree for awhile!
Note for posterity:
This has similar symptoms (but is not the same) as assigning text filters in the global config
, which imposes filters upon user groups based on type/class: administrator, editor, publisher, et cetera (Neil's answer covers this and some alternate approaches).
The above screenshot is personal preference (in my own user profile
) offered to a user with administrator/super user status. I expect all users get some choices, but they may not match these--and of course newer Joomla versions may differ.
add a comment |
As you have found, Joomla filters content to control the HTML content authors submit for security and maybe other reasons.
You can change Text Filter options for each user group in the Global Configuration but I think most editors filter out PHP code anyway.
There are a few ways around this problem.
Disable the Editor
Temporarily changing your user settings to use no editor is a good approach as no additional third party extensions are needed, although (as you have found) content authors who come along later and edit the content may be in for a surprise.
Joomla Extension to List Directory Contents
You can install a third party extension to list the contents of a folder. I tend to use the free or the paid version of Easy Folder Listing and there are others.
Joomla Extension to Retain PHP Code
You can install a third party extension that allows PHP code to be retained without disabling your editor. I tend to use Regular Labs Sourcerer and there are others.
Yes, I found a blog describing Global Config, but I was already set to "no filter." And I'd spent a triumphant nine seconds navigating to that page, certain I'd found the problem--bummer. However it did at least open a new line of thinking, validating my hunch that Joomla was editing on my behalf. Of course from Joomla's perspective I'd requested it. I'd been checking directory perms, file sizes, and other stuff which in the past have proven to produce similar symptoms.Though once I saw the source code I at least left the football field and found myself in the right ballpark.
– zedmelon
May 27 at 18:31
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "555"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fjoomla.stackexchange.com%2fquestions%2f24723%2fhow-to-stop-joomla-2-5-from-disabling-php%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
FIXED:
The culprit was a personal editor choice set in the user profile section.
I changed this to Editor - None
, resubmitted the disobedient code (without comment tags), and it worked like a charm!
Clearly the user who created the original article did not use the TinyMCE, but my account had that selected. I did not create the user account I'm using--though I suspect I wouldn't have noticed this anyway and would still likely have found myself in the same boat.
It's worth noting that TinyMCE was editing the code before I opened it, rather than as I was submitting/saving the post. The PHP was converted to a comment up front, and since I'm a PHP n00b it didn't stand out to me like it should've. I duplicated a comment I assumed was code, and I lacked the programming chops to recognize that.
I'm glad it was something simple, but holy smokes this had me barking up the wrong tree for awhile!
Note for posterity:
This has similar symptoms (but is not the same) as assigning text filters in the global config
, which imposes filters upon user groups based on type/class: administrator, editor, publisher, et cetera (Neil's answer covers this and some alternate approaches).
The above screenshot is personal preference (in my own user profile
) offered to a user with administrator/super user status. I expect all users get some choices, but they may not match these--and of course newer Joomla versions may differ.
add a comment |
FIXED:
The culprit was a personal editor choice set in the user profile section.
I changed this to Editor - None
, resubmitted the disobedient code (without comment tags), and it worked like a charm!
Clearly the user who created the original article did not use the TinyMCE, but my account had that selected. I did not create the user account I'm using--though I suspect I wouldn't have noticed this anyway and would still likely have found myself in the same boat.
It's worth noting that TinyMCE was editing the code before I opened it, rather than as I was submitting/saving the post. The PHP was converted to a comment up front, and since I'm a PHP n00b it didn't stand out to me like it should've. I duplicated a comment I assumed was code, and I lacked the programming chops to recognize that.
I'm glad it was something simple, but holy smokes this had me barking up the wrong tree for awhile!
Note for posterity:
This has similar symptoms (but is not the same) as assigning text filters in the global config
, which imposes filters upon user groups based on type/class: administrator, editor, publisher, et cetera (Neil's answer covers this and some alternate approaches).
The above screenshot is personal preference (in my own user profile
) offered to a user with administrator/super user status. I expect all users get some choices, but they may not match these--and of course newer Joomla versions may differ.
add a comment |
FIXED:
The culprit was a personal editor choice set in the user profile section.
I changed this to Editor - None
, resubmitted the disobedient code (without comment tags), and it worked like a charm!
Clearly the user who created the original article did not use the TinyMCE, but my account had that selected. I did not create the user account I'm using--though I suspect I wouldn't have noticed this anyway and would still likely have found myself in the same boat.
It's worth noting that TinyMCE was editing the code before I opened it, rather than as I was submitting/saving the post. The PHP was converted to a comment up front, and since I'm a PHP n00b it didn't stand out to me like it should've. I duplicated a comment I assumed was code, and I lacked the programming chops to recognize that.
I'm glad it was something simple, but holy smokes this had me barking up the wrong tree for awhile!
Note for posterity:
This has similar symptoms (but is not the same) as assigning text filters in the global config
, which imposes filters upon user groups based on type/class: administrator, editor, publisher, et cetera (Neil's answer covers this and some alternate approaches).
The above screenshot is personal preference (in my own user profile
) offered to a user with administrator/super user status. I expect all users get some choices, but they may not match these--and of course newer Joomla versions may differ.
FIXED:
The culprit was a personal editor choice set in the user profile section.
I changed this to Editor - None
, resubmitted the disobedient code (without comment tags), and it worked like a charm!
Clearly the user who created the original article did not use the TinyMCE, but my account had that selected. I did not create the user account I'm using--though I suspect I wouldn't have noticed this anyway and would still likely have found myself in the same boat.
It's worth noting that TinyMCE was editing the code before I opened it, rather than as I was submitting/saving the post. The PHP was converted to a comment up front, and since I'm a PHP n00b it didn't stand out to me like it should've. I duplicated a comment I assumed was code, and I lacked the programming chops to recognize that.
I'm glad it was something simple, but holy smokes this had me barking up the wrong tree for awhile!
Note for posterity:
This has similar symptoms (but is not the same) as assigning text filters in the global config
, which imposes filters upon user groups based on type/class: administrator, editor, publisher, et cetera (Neil's answer covers this and some alternate approaches).
The above screenshot is personal preference (in my own user profile
) offered to a user with administrator/super user status. I expect all users get some choices, but they may not match these--and of course newer Joomla versions may differ.
edited May 27 at 18:56
answered May 25 at 22:13
zedmelonzedmelon
418
418
add a comment |
add a comment |
As you have found, Joomla filters content to control the HTML content authors submit for security and maybe other reasons.
You can change Text Filter options for each user group in the Global Configuration but I think most editors filter out PHP code anyway.
There are a few ways around this problem.
Disable the Editor
Temporarily changing your user settings to use no editor is a good approach as no additional third party extensions are needed, although (as you have found) content authors who come along later and edit the content may be in for a surprise.
Joomla Extension to List Directory Contents
You can install a third party extension to list the contents of a folder. I tend to use the free or the paid version of Easy Folder Listing and there are others.
Joomla Extension to Retain PHP Code
You can install a third party extension that allows PHP code to be retained without disabling your editor. I tend to use Regular Labs Sourcerer and there are others.
Yes, I found a blog describing Global Config, but I was already set to "no filter." And I'd spent a triumphant nine seconds navigating to that page, certain I'd found the problem--bummer. However it did at least open a new line of thinking, validating my hunch that Joomla was editing on my behalf. Of course from Joomla's perspective I'd requested it. I'd been checking directory perms, file sizes, and other stuff which in the past have proven to produce similar symptoms.Though once I saw the source code I at least left the football field and found myself in the right ballpark.
– zedmelon
May 27 at 18:31
add a comment |
As you have found, Joomla filters content to control the HTML content authors submit for security and maybe other reasons.
You can change Text Filter options for each user group in the Global Configuration but I think most editors filter out PHP code anyway.
There are a few ways around this problem.
Disable the Editor
Temporarily changing your user settings to use no editor is a good approach as no additional third party extensions are needed, although (as you have found) content authors who come along later and edit the content may be in for a surprise.
Joomla Extension to List Directory Contents
You can install a third party extension to list the contents of a folder. I tend to use the free or the paid version of Easy Folder Listing and there are others.
Joomla Extension to Retain PHP Code
You can install a third party extension that allows PHP code to be retained without disabling your editor. I tend to use Regular Labs Sourcerer and there are others.
Yes, I found a blog describing Global Config, but I was already set to "no filter." And I'd spent a triumphant nine seconds navigating to that page, certain I'd found the problem--bummer. However it did at least open a new line of thinking, validating my hunch that Joomla was editing on my behalf. Of course from Joomla's perspective I'd requested it. I'd been checking directory perms, file sizes, and other stuff which in the past have proven to produce similar symptoms.Though once I saw the source code I at least left the football field and found myself in the right ballpark.
– zedmelon
May 27 at 18:31
add a comment |
As you have found, Joomla filters content to control the HTML content authors submit for security and maybe other reasons.
You can change Text Filter options for each user group in the Global Configuration but I think most editors filter out PHP code anyway.
There are a few ways around this problem.
Disable the Editor
Temporarily changing your user settings to use no editor is a good approach as no additional third party extensions are needed, although (as you have found) content authors who come along later and edit the content may be in for a surprise.
Joomla Extension to List Directory Contents
You can install a third party extension to list the contents of a folder. I tend to use the free or the paid version of Easy Folder Listing and there are others.
Joomla Extension to Retain PHP Code
You can install a third party extension that allows PHP code to be retained without disabling your editor. I tend to use Regular Labs Sourcerer and there are others.
As you have found, Joomla filters content to control the HTML content authors submit for security and maybe other reasons.
You can change Text Filter options for each user group in the Global Configuration but I think most editors filter out PHP code anyway.
There are a few ways around this problem.
Disable the Editor
Temporarily changing your user settings to use no editor is a good approach as no additional third party extensions are needed, although (as you have found) content authors who come along later and edit the content may be in for a surprise.
Joomla Extension to List Directory Contents
You can install a third party extension to list the contents of a folder. I tend to use the free or the paid version of Easy Folder Listing and there are others.
Joomla Extension to Retain PHP Code
You can install a third party extension that allows PHP code to be retained without disabling your editor. I tend to use Regular Labs Sourcerer and there are others.
answered May 27 at 0:14
Neil RobertsonNeil Robertson
6,79921655
6,79921655
Yes, I found a blog describing Global Config, but I was already set to "no filter." And I'd spent a triumphant nine seconds navigating to that page, certain I'd found the problem--bummer. However it did at least open a new line of thinking, validating my hunch that Joomla was editing on my behalf. Of course from Joomla's perspective I'd requested it. I'd been checking directory perms, file sizes, and other stuff which in the past have proven to produce similar symptoms.Though once I saw the source code I at least left the football field and found myself in the right ballpark.
– zedmelon
May 27 at 18:31
add a comment |
Yes, I found a blog describing Global Config, but I was already set to "no filter." And I'd spent a triumphant nine seconds navigating to that page, certain I'd found the problem--bummer. However it did at least open a new line of thinking, validating my hunch that Joomla was editing on my behalf. Of course from Joomla's perspective I'd requested it. I'd been checking directory perms, file sizes, and other stuff which in the past have proven to produce similar symptoms.Though once I saw the source code I at least left the football field and found myself in the right ballpark.
– zedmelon
May 27 at 18:31
Yes, I found a blog describing Global Config, but I was already set to "no filter." And I'd spent a triumphant nine seconds navigating to that page, certain I'd found the problem--bummer. However it did at least open a new line of thinking, validating my hunch that Joomla was editing on my behalf. Of course from Joomla's perspective I'd requested it. I'd been checking directory perms, file sizes, and other stuff which in the past have proven to produce similar symptoms.Though once I saw the source code I at least left the football field and found myself in the right ballpark.
– zedmelon
May 27 at 18:31
Yes, I found a blog describing Global Config, but I was already set to "no filter." And I'd spent a triumphant nine seconds navigating to that page, certain I'd found the problem--bummer. However it did at least open a new line of thinking, validating my hunch that Joomla was editing on my behalf. Of course from Joomla's perspective I'd requested it. I'd been checking directory perms, file sizes, and other stuff which in the past have proven to produce similar symptoms.Though once I saw the source code I at least left the football field and found myself in the right ballpark.
– zedmelon
May 27 at 18:31
add a comment |
Thanks for contributing an answer to Joomla Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fjoomla.stackexchange.com%2fquestions%2f24723%2fhow-to-stop-joomla-2-5-from-disabling-php%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
I can't accept my own answer yet, but I plan to (can't for two days). I didn't realize there's an editor choice in the Joomla UI.
– zedmelon
May 25 at 22:19
1
Good comprehensive posts @zedmelon I love to see question which show exhaustive investigation and toil (I wish all posted questions were this way). Please continue to post your Joomla questions in this community. Please take the tour.
– mickmackusa
May 25 at 22:56
Yes, great to see such an exhaustive and well documented question.
– Neil Robertson
May 27 at 0:16
Thank you gentlemen. It's nice when my tendency to talk (way) too much actually proves useful :,)
– zedmelon
May 27 at 18:21
On a more serious note, I do try to (a) fix stuff on my own (b) research before requesting help, and (c) remember that others are helping me out of benevolence, and making it easier for them not only (1) gets it done sooner, but (2) is respectful, which is non-negotiable.
– zedmelon
May 27 at 18:38