A new client called us this evening and told us that she’s seeing a blank page when saving a K2 item. She told us that the item was being saved correctly despite the blank page. Hmmm…
A blank page, as you might have already guessed, is a sign of a fatal error somewhere. So what we did was that we enabled error reporting by going to Site -> Global Configuration -> Server and changing the value of “Error Reporting” to “Maximum” (and, of course, clicking on “Save” on the top right). After doing that, we tried to save a K2 item and, unsurprisingly, we saw the following error:
Call to undefined function iconv in /administrator/components/com_finder/helpers/indexer/parser/html.php on line 33
Aha! Apparently, the PHP instance that was running did not have the iconv module installed and enabled, and that’s why the problem was happening.
But what to do?
Well, there are three solutions:
- Solution #1: Install the iconv module
Installing the iconv module is easier said than done, because it requires rebuilding PHP on the server with the iconv option – a task that can only be done by a real system administrator who actually knows what he’s doing. We recommend to contract this work to your hosting company (some hosting companies may do it for free, other hosting companies may refuse to do this) or to a company specialized in the administration of Linux servers.
-
Solution #2: Modify Joomla’s core
This is a much easier solution than the first one, but, on the flip side, you will be modifying Joomla’s core, which means that a Joomla update may potentially overwrite your changes. But, if you’re willing to take the risk, then here’s how to do this (it’ll literally take minutes):
- Open the file html.php located under the /administrator/components/com_finder/helpers/indexer/parser directory.
-
Add // to the beginning of line 33. So, instead of this line:
$input = iconv("utf-8", "utf-8//IGNORE", $input);
you would have this line:
//$input = iconv("utf-8", "utf-8//IGNORE", $input);
Note: You can remove line 33 altogether – but it’s better to leave it there, just in case you want to revert back.
-
Save the file and upload it back.
-
The problem is solved!
-
Solution #3: Disable Smart Search
Although we have offered two solutions to the problem so far, we haven’t mentioned yet the root cause of the problem, which is Joomla’s Smart Search.
But what is Smart Search?
Smart Search is a Joomla technology used to handle search on the website more efficiently. Joomla claims that Smart Search returns better, faster results than Joomla’s standard search (which is completely inefficient – according to Joomla’s official website). But this “efficiency” comes at an expense – it creates a lot of redundancy at the database level and it can create problems on the website, such as the iconv problem which we are currently discussing. Additionally, if your website is extremely large, then it is recommended to disable Smart Search because it can do more harm than good. (it’ll slow down the website)
So how do you disable Smart Search?
Well, disabling Smart Search couldn’t be easier. All you need to do is to login to the backend of your Joomla website, and then go to Extensions -> Plug-in Manager, and then from the “Select Type” drop down, choose “finder”. Once you do that, you will need to disable all the plugins listed (by clicking on the green checkmark next to each plugin).
Disabling Smart Search will fix the issue. We also think that it is the best solution, because according to Joomla’s official website, Smart Search is still not very stable. So while Smart Search may offer a better search experience to your users, it is better to avoid it if you can.
We hope that you found our post useful and that it helped you fix your problem. If it didn’t, or if you don’t have the technical skills to do the above (or if you’re just afraid to do it), then please contact us. We’ll fix the problem for you as soon as possible and we will charge you a very reasonable fee.
In closing, it’s almost July 1st here in Montreal (well, it’ll be July 1st in an hour), so Happy Canada Day to you if you’re a Canadian.
I tried all solutions. They didn’t work. I in fact ended up disabling all Smart Search plugins and cleared cache a few times. No go.
Gus
Have you tried setting your error reporting to maximum in your configuration settings? Which error do you see when you save a K2 item?
Hi There, I have the same problem, these solution did not work for me to…I have put the error reporting to max but I don’t see any error when adding a new item from the back screen…
Gus, did you find a solution to your problem…?
Thanks!
Hi Benoit,
You might be interested in reading this post on why sometimes Joomla doesn’t display the errors despite the fact that error reporting is set to maximum: http://www.itoctopus.com/why-is-it-that-joomla-sometimes-doesnt-show-the-errors-even-if-error-reporting-is-set-to-maximum
If you need further help, please don’t hesitate to contact us!
You’re absolutely amazing! I just transferred my server and was struggling with this exact issue, as I was getting a blank page after saving any K2 Items! Even though I enabled error reporting, the system couldn’t print any issues, but your post appearing on Google Search literally saved my day! God bless you :)