Jump to content

WHMCS 7.41 - Orders --> Add New Order -- no search?


mtindor

Recommended Posts

Wondering if anyone else is having this issue.

When logged into WHMCS 7.4.1 as an admin, do this:

1.   Select Orders --> Add New Order

2.   Start typing (a known existing) client name in the "Client" box

What should happen is that it should start displaying possible clients as you type, just as the search boxes autofill the possibilities when you start typing a search.

This used to work in 7.2.x for me.   After I upgraded to 7.4.1 (via the auto update feature), this stopped working.   I then renamed public_html and replaced it with a full WHMCS 7.4.1 distribution.   Same thing happens.

Normally, if I typed something like "Tin" in the Orders --> Add Order --> Client box, it would automatically show my own billing account.   Now it doesn't bother to display anything.

Mike

 

Link to comment
Share on other sites

I see what's happening now.   This has to do with using the "Full Friendly Rewrite" or "Friendly index.php" under General --> Friendly URLs.   If I switch to "Basic URLs", things work again.

error_log shows the following when trying to access ordersadd.php with either "Friendly index.php" or "Full Friendly Rewrite" selected as the Friendly URLs setting:

[Wed Dec 06 10:36:48.952917 2017] [proxy_fcgi:error] [pid 7436:tid 140664180262656] [client 10.0.0.10:58987] AH01071: Got error
'Unable to open primary script: redirect:/index.php (No such file or directory)\n', referer: https://my.example.com/myadmindir/orde
rsadd.php

Anyone have any suggestions?   Can anyone else reproduce this issue?

Mike

Link to comment
Share on other sites

Hi Mike,

13 minutes ago, mtindor said:

Anyone have any suggestions?   Can anyone else reproduce this issue?

I could - but only using Full Friendly... with the other two settings, it worked fine.

however, after I clicked the "Update Rewrite Rules" button, it now works on all 3 settings.

image.png.be24c1a7bd1b46b7ae3debef7a0242d7.png

Link to comment
Share on other sites

Hmm.   I switched to Basic, and everything worked fine again.    Clicking the update rules setting changed the contents of .htaccess and Friendly URLs now shows "Full Friendly Rewrite", but my particular setup isn't working with that setting still.

Thanks for testing though.  That at least confirms that there may be an issue (outside of my setup).   I guess most people never add an order manually.

Mike

 

Link to comment
Share on other sites

The error I see in error_log is different depending upon whether I choose "Friendly index.php" or "Full Friendly Rewrites"

# Friendly index.php

[Wed Dec 06 11:30:39.046164 2017] [proxy_fcgi:error] [pid 9261:tid 140482256557824] [client 10.1.1.10:61642] AH01071: Got error 'Unable to open primary script: /home/someuser/public_html/myadminurl/search.php/client (No such file or directory)\n', referer: https://my.example.com/myadminurl/ordersadd.php

# Full Friendly Rewrites

[Wed Dec 06 11:21:55.454171 2017] [proxy_fcgi:error] [pid 8742:tid 140088369456896] [client 10.1.1.10:61230] AH01071: Got error 'Unable to open primary script: redirect:/index.php (No such file or directory)\n', referer: https://my.example.com/myadminurl/ordersadd.php

Link to comment
Share on other sites

Thanks, Brian.  I may do that.    I do have an update on this issue (in my environment).   It now behaves as yours does, meaning that the Client box at /myadminurl/ordersadd.php now works with both the Basic URLs and Friendly index.php settings.    Now it only doesn't work with the Full Friendly Rewrites setting.    And, my error_log generates no more errors.

What resolved the errors seen in error_Log (and what resolved my issue with Friendly index.php not working) was changing to cgi.fix_pathinfo=1 in my php.ini.   That's the default, and that's how it should have been, but for whatever reason it was set to 0 in my php.ini.

So, the only issue that remains is the Client box search in /myadminurl/ordersadd.php not working when Full Friendly Rewrites is set.

Mike

 

 

Link to comment
Share on other sites

No dice from WHMCS Support via ticket, mainly because I won't allow anybody access to my billing system.   I'm disappointed that they wouldn't even venture a guess though.   Certainly if somebody there were to give it 30 seconds of thought they could point me in some direction to troubleshoot.

At any rate, I used the Firefox Developer Tools --> Network Tab to see what was being sent by the browser when I would click on the Orders --> Add New Order --> click on Client search box, and here is what the browser sends depending upon the URL rewriting scheme used.

https://my.example.com/myadminurl/index.php?rp=/myadminurl/search/client - Basic URLs - works fine
https://my.example.com/myadminurl/index.php/myadminurl/search/client - Friendly index.php - works fine

- server sends back a list of first 30 active clients in my billing system when I click on the Client box in Orders --> Add New Order

https://my.example.com/myadminurl/search/client - Full Friendly Rewrite - does not work

- server sends back nothing when I click on the Client box in Orders --> Add New Order

So, it looks like the browser does not POST /search/client to /myadminurl/index.php with Full Friendly Rewrite enabled. and instead POSTs it to /myadminurl .   Of course, that still leaves me wondering if it's simply an issue with rewrite rules or if it is an issue with my PHP-FPM / php.ini settings.

It sure would be nice if a couple more people would try all three options, see if they can reproduce the problem, and report back.

Mike

 

Link to comment
Share on other sites

  • WHMCS Developer

Mike, 

Sorry to hear you are having issues with the Full Friendly Rewrite option within your WHMCS installation. The full rewrite option requires that Apache's mod_rewrite is available on your server. The other two options, do not require this behaviour. It could be that your system is not configured in a way that supports mod_rewrite? You can find a little more info on the different options available on our documentation at Friendly URLs.

It is difficult to diagnose any issue with this without checking the environment. However, if your system does have mod_rewrite available, then you could try increasing the logging level temporarily to attempt to see where the rewrite is being sent to. 

Are you getting a 404 error when full rewrite is enabled?

Is the content of your .htaccess file just the stock WHMCS content?

Hopefully, I have provided some information to aid in the diagnosis of your problem.

Link to comment
Share on other sites

Hi Andrew,

mod_rewrite is active.   Every part of the billing system (as far as I can tell) is working just fine with the friendly URLs except for Orders --> Add New Order --> click on the "Client" box.

1.   No 404s

2.   .htaccess file only contains the stock WHMCS content

If I switch to Basic URLs, all content is removed from .htaccess, and then if I switch to Full Friendly Rewrite the stock WHMCS rules are written to .htaccess.   Using various rewrite rules is not anything new on my installation.    I've had it installed on this system since 2013 and were using the various rules included in the htacess file included with the distro in the past.

As I mentioned in my previous post, with Full Friendly URLs enabled it seems to be POSTing to /myadminurl when I click on the "Client" box in Orders --> Add New Order, when in fact I think it should be POSTing to /myadminurl/index.php.     When using Basic URLs or Friendly index.php options, everything works and the browser is POSTing to /myadminurl/index.php.

I'll increase the logging verbosity and see if I can find anything odd.

Mike

 

Link to comment
Share on other sites

Hi Mike,

2 hours ago, mtindor said:

No dice from WHMCS Support via ticket, mainly because I won't allow anybody access to my billing system.

understandable - i'm not sure i'd let them loose on any of ours unless it was absolutely critical... perhaps not even then. :P

do you get your license direct from WHMCS? if so, perhaps get a developers license, create a dummy installation on the same server, add a client and see if the same issue occurs... if it does, give Support access to the dev to play with.

2 hours ago, mtindor said:

https://my.example.com/myadminurl/search/client - Full Friendly Rewrite - does not work

- server sends back nothing when I click on the Client box in Orders --> Add New Order

our 7.4.1 dev uses the same URL, but works.

if it helps, I see the same thing as you on the Softaculous WHMCS Demo using FFR... though obviously for security reasons, this is less tweak-able than normal installations and I don't know if mod_trwrite is enabled.

Link to comment
Share on other sites

Brian,

That's a great suggestion.   Yes, I do get my license direct from WHMCS.    I did figure out, after all of these years, that any rewrite rules in .htaccess were not actually working because of my AllowOverride None directive in Apache for my WHMCS directory.    How dumb of me.

In Apache, I ended up setting, at <Directory> level, these:

        AllowOverride FileInfo
        AllowOverrideList RewriteBase RewriteCond RewriteEngine RewriteMap RewriteOptions RewriteRule

I then renamed .htaccess and made one of my own to test rewrite rules of /* to a specific URL and it indeed did work.   I then commented out my AllowOverride* directives in Apache (in effect defaulting them to None, like they were before), and verified that mod_rewrite wasn't active.   So I know the rules weren't even being processed before today.   I then uncommented my AllowOverride* directives and verified again that mod_rewrite was processing rules.   I then switched back to using the .htaccess file that WHMCS writes, but still cannot get Full Friendly Rewrites to work.

I'll attempt to get a dev license and test on a development site and see what happens, if I can't figure out the issue within the next hour.

Mike

Link to comment
Share on other sites

3 minutes ago, WHMCS Andrew said:

Another thing to note is that the same search is being completed on the Clients profile list in the admin area (the dropdown at the top of any clientsxxx page, clientssummary.php etc) - does the dropdown work there for you correctly in full rewrite?

Hi Andrew,

Yes, those have worked (historically) and continue to work now, regardless of which URL setting I use.   On those search boxes I have to type a partial in and then hit Enter.   I'm unsure if I had to hit enter before.     But, on the Add New Order --> Client search box it does not work if I type in a partial, or if I type in a partial and hit enter, when in Full Friendly Rewrites mode.     In either of the other two modes,  I can just click on the box and it will start giving me possibilities.

Mike

 

Link to comment
Share on other sites

  • 1 month later...
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated