hey guys was hoping you could help me out..
i was asked to fix a query for someone which wasnt working. fixing the query is a rather simple problem, but i cant seem to be able to find where that query is located.i know php and mysql, but not really familiar with codeigniter framework.
any ways, the form which results in the query being called has
action="/support/managemyaccount/profile/search"
if you could help me figure which filethe query would be in it would be great.
The file should be called support.php, under the application/controllers folder.
Within that file, you should find only one class. Within that class, look for a method named managemyaccount. That's where your query is most likely to be.
Related
I was hoping someone could help me with something i've been stuck on. I'm not even sure if it's possible to do.
So i basically have a huge Json file which includes all objects used for a certain slide Specifically i used this GET command:
GET https://slides.googleapis.com/v1/presentations/{presentationId}
I then got a huge 200.000 line Json response which has alot of stuff like colors for each thing, position of every element on each slide ect. I save this as a JSON file on my pc. I only need it once as a form of template.
Then my golang code dynamically edits some of its values (after converting it to structs ofc).
Now i want to POST it back up. It has a new name now, new ID, but 99,9% of the values are the same.
Is it possible to do this?
And sorry in advance. I know people here tend to get mad at "stupid questions" or if i forget to add something, but i'm new here, and i hope I can get some help. Been stuck for a long while.
Yes, you can. There is a Go client library that allows you to do this if you're not set on using a REST API. If you are set on using a REST API, you should be able to post this endpoint:
POST https://slides.googleapis.com/v1/presentations/{presentationId}:batchUpdate
Side note, the Google documentation (imo) is fantastic, a little googling goes a long ways :)
I'm looking for some guidance here.
Scenario:
I have a Post model with a polymorphic relation to a Comment model. Whenever I want to create a new comment for a given post I have the following endpoint:
$router->post('/posts/{post}/comments', 'PostsCommentsController#store');
So far so good. Now I want to add an Attachment model which will also be a polymorphic relation since I may need to add attachments to more things other than comments (ex: messages, etc).
My first idea was doing something in the lines of:
$router->post('/posts/{post}/comments/attachments', 'PostsCommentsAttachmentsController#store');
So the comment will belong to a post and will have an attachment.
This feels a bit "dirty" to me (especially the controller name) and the need of having 3 nested resources (maybe I'm just thinking too much).
Hope I was clear enough explaining my problem :)
Have anyone faced something like this before? How did you guys solve it?
Other approaches? Am I thinking completely wrong?
Open to ideas and suggestions :D
Thank you all.
I'd prefer Single Responsibility for each Controllers or route. So it's pretty clear what their actually do and handle. Let me give you example:
- Post
/posts -> list all post
/posts/{id} -> get specific post
/posts/{id}/comments -> get comments of the post
- Comment
/comments/{id} -> get specific comment
/comments/{id}/attacments -> get attacments of a comment
- Attachment
/attachment/{id} -> get specific attachment
For Controller name, just keep it simple. Just usePostController, CommentController and AttachmentController. It's quite clear I think.
After more researching, I actually realized that what I wanted to do was basically a file upload with metadata.
Came across this excellent post: HTTP/REST API File Uploads that explains it
PS: Thank you Dharma for the help and time.
I was hoping someone had some experience using the entsp flag in GSA and was able to point out what I am doing wrong. I've read the documentation but can't figure it out.
The query string I am passing through is:
?as_sitesearch=examplesite.com&callback=angular.callbacks._1&collection=hybrid_site_colection&entsp=a__di_site_biasing&frontend=jsonp&num=10&query=test&start=0
I've set up the biasing in the GSA, and when I apply it to the frontend itself, it behaves. But I was hoping to pass it in dynamically, as I believed you could (we are likely to want to dynamically pass through one of a few biasing, depending on where the user is coming from), it makes no difference.
Am I missing a tag, or can someone see anything else wrong?
Sorry, peoples, I've seen now that the problem is that we are going through a JSON bridge that isn't passing through my variables.
When I go directly to the GSA with a frontend, it works.
I'm facing some problem regarding to query hit for generating suggestion.
Please take a look below URL structure and suggest the appropriate URL modification.
http://{host-name}/search?start=0&num=1000&site=bhtest&output=xml&client=pp_frontend&filter=0&getfields=*&q=sken+inmeta:contenttype~Product%20OR%20inmeta:contenttype~Content
In the above query, search term is "sken", GSA suggestion tag should appear and provide suggestion for "skin" but it is not happening
When I change the query to:
http://{host-name}/search?start=0&num=1000&site=bhtest&output=xml&client=pp_frontend&filter=0&getfields=*&q=sken
Then it provides the suggestions.
Can you please help to find out the problem in first one URL.
Suggestions are not returned when you add metadata filters. See the search protocol reference found here
The way to work around this is to issue two queries, one with your filter and one without.
It is related to language parameter in my oppinion. Try use &lr and &hl parameters. GSA suggest by this parameters.
I'm having a little trouble with a CodeIgniter route when there is a query (stuff after the ?) in the URI. I know it is good practice to replace queries with routes in CI, but I'm importing in a premade messageboard that already does everything with queries. This is my route:
$route['messageboard/:any'] = "messageboard/index";
Any in this case refers to a script name. So if it's messageboard/admin.php, I have it load a view that loads my premade messageboard's script "admin.php". It's working just fine if I do messageboard/admin.php. It does fine if I do messageboard/admin.php?. If I put a parameter into the query, however, the route won't correctly send the user to the messageboard controller, and instead sends them to a 404. Does anyone have any ideas on how to make this work? I would be eternally grateful. Thanks!
Okay guys, I solved it. I needed to change three things. The first was mtvee's suggestion, which lets it read query strings. The second one you're going to want to change the $config['permitted_uri_chars'] in the config file to include an equals sign, since it starts off disabled and all query strings will be of the for ?a=34 or something like that. The third is you need to go to $config['uri_protocol'] and change it from AUTO to PATH_INFO. Once I did those, it worked.
I'm sure the syntax is:
$route['messageboard/(:any)'] = "messageboard/index"; //<-- notice brackets
and not
$route['messageboard/:any'] = "messageboard/index";
I believe CI doesn't do GET out of the box. Check out Enabling Query Strings here http://ellislab.com/codeigniter/user-guide/general/urls.html