How to resolve this issue in CakePHP controller - forms

Please, can someone help me out and tell me what is wrong with my CakePHP app registeri controller method code on GitHub? https://github.com/olaolu20077/jobtest.git
I'm having an issue with form submission on it, because I'm not getting redirected to homepage and no flash success message coming up on form submission.
Thank you.
I added flash ->render()?> To my layout and debug ($user75z->get error(); exit; to the upper part of the flash error message in the controller, yet got no solution to the form submission.

Can you try to do dd{$user75z) before saving it? See if you get any errors from it, maybe also consider renaming your variables. This makes the code less messy.
EDIT: I see you also use the same lines of code in almost every controller method, maybe try putting these in the entity or table?

Related

PageExpiredException occurs after closing of ModalWindow

Currently I'm trying to upgrade the application from wicket 1.4 to wicket 6 and I'm stuck with the following issue:
When I try to close ModalWindow, it is closed but I receive PageExpiredException on the page where I was opening this ModalWindow, so I'm redirected to
/myapp/wicket/bookmarkable/org.apache.wicket.markup.html.pages.PageExpiredErrorPage
I thought maybe the way I create ModalWindow is outdated, so I've tried an example from here
http://www.wicket-library.com/wicket-examples-6.0.x/ajax/modal-window?0
and it gives me the same exception.
Maybe I have to configure something in my WebApplication implementation, but I don't know what.
If anyone could help, it'll be really appreciated. Thanks.
Check your server logs for errors related to the serialization of the opener page. PageExpiredException means that the page cannot be found in the page storage. If there was an error with the serialization then it won't be stored and thus later won't be found too.

MagnificPopup won´t work with Typo3

I would like to use magnific popup for a site which is still in development, but unfortunately nothing happens after the installation and adding the static content in my template.
No matter what i try no popup comes up.
If someone would like to help me i will provide access to the site.
Thanks a lot!
First thing to do:
look at your source code: does the 'link' show any sign of 'magnific popup' code?
Added classes? id?
Second: do you see any extra javascript and/or stylesheet that is added by the extension?
If you answer negative to 1 of these, the extension does not output anything. Sounds logic, but it is the first step. Is it a solution? Nope, it means your live just got a bit more worse, but hang in there !
If it does show any code from the ext: look at your console, are there any js errors occurred ? (if you don't know what console is, or (even worse) you work with IE) please read about chrome console of at least install Firefox with firebug.
My best beth would be a JS error...
Can it be possible that the ext itself does not work?
Does your php error logs tell you that the extension is behaving badly?
Do you see errors in the typoscript analyser (or whatever it's called to analyse the css_styled_content and other TS spaghetti )
If not, then no, it is not the ext.
Again, i'm betting my wive, three horses and a barrel of beer on JS erros.
Good luck mate !
ps: IF i'm wrong, i'm not sending you my wife by postal service. Loads of trouble last time. Nor the horses, same shizzle ..

Concrete5 isEditMode()-like handler to get Information about active editing or publishing

So my question is if there is a Concrete 5 handler/listener instead of
isEditMode()
that tells if the user is in active Editing mode or if he just has published his Edit?
Something like
isPublished() or isEditModeActive()
Thx yall
thanks for your interest!
So i tried the Eventhandler in the way it is decumented in the second example:
1. i created site_events.php in the /config
2. i added
<?PHP Events::extendPageType('inhalt', 'on_page_version_approve');?>
i added to the site.php
define('ENABLE_APPLICATION_EVENTS', true);
on the reffered inhalt.php pagetype i added
function on_page_version_approve() {
echo "page published";
}
... nothing happens.
In the description it is written, that the refferring inhalt.php has to exist in /controllers. However, this is not the case. I actually dont quite understand the structure of the Eventhandling. It would be great if you could help me out there...
Thanks in advance anyways :)
It sounds like you want what concrete5 calls Events (http://www.concrete5.org/documentation/developers/system/events/).
As per the docs, you'll get the Page as arguments to the functions you register.
There is nothing quite as specific as what you're looking for, but:
For published, use on_page_version_approve.
For editing, try on_before_render. It's a bit generic (ie, it'll be getting called far more than you're interested), but you can do something like if ($page->getCollectionCheckedOutUserID()). You should experiment a bit with this, though. For example, if you check out the home page for editing, and then someone else loads the live version, the event will probably get called again, and the Page will probably show "checked out". But maybe you can check ->isEditMode(), which should check it against the logged in user...

User Authorization in KohanaPHP App vs Endless Loop

Wondering how to name this question. Think this is the best situation possible.
Situation:
I got small app written in KohanaPHP framework. However there's one small bug that makes my crazy.
I got my own Core_Controller that is extended by every controller in this app. In constructor of this controller, I'm checking user profile status. So far so good. Although I'm facing a logical issue. It's called endless redirect loop. If I try to redirect (in Core_Controller constructor) user to Member_Controller it cannot be workig due to endless lopp. I understand why it happen.
Solution:
I'm looking for a solution how to make it flexible. I tried to move this verification to a helper and call it in Core_Controller constructor. However, it can be working correctly.
Question:
Do I have to put verification in constructor of every single controller? IS there any universal method to do it?
Waiting for your thoughts.
M.A.
Just check if user is verified and the current request's action isn't something like member/verification, do the redirect.
And parent::__construct(); will call the parent constructor, so I don't see the problem in that either..
You need a condition where it doesn't redirect (on the page you have redirected to). You'll want some code similar to this.
if not member_controller then
redirect to member_controller
else
do nothing
endif
The else isn't needed, but just added so it's more clear to you.

ZEND plugin running twice. Why or how to simulate it?

Im hours and hours finding why one of my ZEND plugin sometimes running twice (depends on URL)
Note that my plugin has preDispatch and postDispatch methods and when I debugging the code it works like this:
MY_Plugin:preDispatch (echo $_SESSION['DBG'] has value)
MY_Plugin:postDispatch (unset($_SESSION['DBG']))
and then again
MY_Plugin:preDispatch (echo $_SESSION['DBG'] not exist)
MY_Plugin:postDispatch
This is part of bootstrap code
$_SESSION['DBG'] = 'value';
$MYrouter = new MY_Router_MyRouter();
$frontController->setRouter($MYrouter);
$frontController->registerPlugin(new MY_Plugin());
Do you have any suggestion how this could occur or how can I simulate this.
Thanks for any suggestion
Cervenak
Thanks guys for lot of valuable hints.
Now watch my story :)
First I had turned off showing exceptions (parameter False). So I switch them ON to see exception notification.
$frontController->throwExceptions(true);
Than I saw that I dont have uploaded controller and view files. After uploading them ZEND started to work corectly.
Good to know to have this direction set ON during debugging. You could probably save hours.
The dispatcher loop most likely running twice (the controller is dispatched twice). Possible causes:
using action view helper
calling _forward
redirector action helper
manually calling dispatch()
dispatch loop aborted and started again (eg. resetting request params)
Also, take a look at this ZF flow diagram (hotlinked from php-professionals.com)
Another reason could be an missing favicon.ico :-)
If the Apache cant find it, it fires a second request.