Protoype/Scriptaculous Autocomplete - asp.net

I am getting this error when trying to select a object in my autocomplete
This only comes up in IE 8, and Firefox 3.5, not IE 7 or FF 3.0
Error: uncaught exception: [Exception... "An invalid or illegal string was specified" code: "12" nsresult: "0x8053000c (NS_ERROR_DOM_SYNTAX_ERR)" location: "http://localhost/js/prototype.js Line: 2853"]
P2N.Submission.autoSuggest.init('',
'place-list',
'hiddenPlaceID',
'/placeSearch.ashx?cityID=&allowNewPlace=',
'place-search-spinner', {resultID : '' });
Update:
p2n is
var P2N = {
returnVal: null,
errorMsg: null,
initWindow: function() {
},
addSpinner: function(el) {
if(!$(el).next('img.spinner'))$(el).insert({after: '<img src="/img/spinner_small.gif" alt="" class="spinner" />'})
},
removeSpinner: function(el) {
var spinner = $(el).next('img.spinner');
if (spinner != null) spinner.remove();
}
autoSuggest.init I believe is prototype version 1.6, and Scriptaclous vers 1.8
While they also are loading jquery ver 1.3.2
I believe it may be a conflict in all of these, but why would it work in older browsers?
};

We had the same problem - it's definitely a bug in prototype.js 1.6.0.x. Upgrading to 1.6.1 fixed it.

Related

Nuxt3: Why cannot read properties of undefined (not sure if hydration error)?

I am trying to troubleshoot what I suspect might be a hydration issue (not sure).
First, when I run my Nuxt 3 app locally, I get the following server error:
[nuxt] [request error] Cannot read properties of undefined (reading 'public_id')
at _sfc_ssrRender (/C:/Users/XXX/Desktop/work/XXX/.nuxt/dist/server/server.mjs:36425:25)
The template code for the above error is referenced here:
/pages/post/[id]/index.vue:
<img
:src="
post.data.public_id //<----- the 'public_id' error referenced above
? config.public.cloudinaryBaseURL +
config.public.cloudinaryCloudName +
'/c_scale,f_auto,q_auto:best,w_900/' +
post.data.public_id
: '/images/placeholder.svg'
"
:alt="post.data.title"
class="img-fluid rounded-0 rounded-top"
style="border-top-right-radius: 0% !important"
/>
Commenting the above code out of the template, the error then jumps to the next line in the template code:
<figcaption class="figure-caption flex-grow me-auto">
{{ post.data.caption }} //<---- error jumps here after the above code commented out
</figcaption>
Locally, the above error is not a problem....the app works fine. Deploying to production, the page works but when you refresh the page, the error is a little different and the app's console says:
TypeError: Cannot read properties of null (reading 'data')
at Proxy.<anonymous> (index-fcf8af7d.mjs:1:11056)
at Ja (entry-52e152da.mjs:4:4370)
at $e (entry-52e152da.mjs:4:38329)
at $o.U [as fn] (entry-52e152da.mjs:4:38418)
at $o.run (entry-52e152da.mjs:1:4900)
at B.d.update (entry-52e152da.mjs:4:38728)
at B (entry-52e152da.mjs:4:38754)
at entry-52e152da.mjs:4:8797
Data is being fetched using server route api like so:
/pages/post/[id]/index.vue:
const { data: post } = await useFetch(`/api/posts/${route.params.id}`, {
initialCache: false
})
/server/api/posts/[id].ts:
import { firestore } from '#/server/utils/firebase'
export default defineEventHandler(async (event) => {
const postRef = firestore.doc(`posts/${event.context.params.id}`)
const snapshot = await postRef.get()
if (!snapshot.exists) {
return {
statusCode: 404,
body: JSON.stringify({
message: 'Post not found'
})
}
} else {
const data = snapshot.data()
return {
data
}
}
})
Does anyone have any advice on how I can fix the above error? Is there a better way to call the server route to alleviate this error?

Error: Unrecognized operator: $nearSphere in meteor js

i have simple code in meteor js for find near by garages within 10 Kilometres the query works fine in my mongodb database if run it manually in robomongo it works fine but when i run it in my routes it throws an error. like this.
Error: Unrecognized operator: $nearSphere in meteor jsi
i see some blogs they said you need to call a server side method for this. so i use below code to call a server side route.
Router.route('/search/:name',
{name:'searchlist',
data:function(){
var searchedParams = this.params.name.split('-');
var lat = searchedParams.pop();
var lng = searchedParams.pop(1);
return {searchValue: Centers.find({ coordinates: { $nearSphere: { $geometry: { type: "Point", coordinates: [lng,lat] }, $maxDistance: 10000 } } })}
}
}, { where: "server" }
);
if anyone have idea please help.
You're mixing definitions for client and server side routes.
Server-side route should look like this:
Router.route('/search/:name', function(...){...}, { where: 'server' });
Client-side route could look like this:
Router.route('/search/:name, { ... });
Thus, your route is actually client-side route and minimongo doesn't have support for $nearSphere operator as noted here: https://github.com/meteor/meteor/blob/devel/packages/minimongo/NOTES
First, look at Styx answer and make the route a client route by eliminating this part:
', { where: "server" }'
Now that the router is available to the client, let's fix the $nearSphere issue, by changing the operator to $near. Use the following code:
Centers.find(
{
geoloc: {
$near: {
$geometry: {
type: "Point",
coordinates: [lng, lat]
}
}
}
}
);
Give it a try and let me know if it works.

Subpanel not getting open in suagarcrm 7.8 version

I updated Sugar from version 7.6 to 7.8 i add some custom code in subpanel-list.js and it was working perfect in 7.6 version . But now in 7.8 version due to this code subpanel is not working . Can any one tell me the solutions for that.
I tried to ask this question to sugar support team but they told me that it is related to custom code , so need to ask to sugar developers.
I am providing my code which was working on 7.6 but due to this code now in 7.8 subpanel is not working.
({extendsFrom: 'SubpanelListView',
//contextEvents: {"list:inviteportal:fire": "renderOnInvitePortal"},
initialize: function(options) {
// this.dataViewName = options.name || 'subpanel-list';
this._super("initialize", [options]);
this.context.on('list:inviteportal:fire',this.renderOnInvitePortal, this);
},
renderOnInvitePortal: function(model){
app.api.call('read',app.api.buildURL(model.get('_module'),'read',{id:model.get('id')}),null,
{
success: function(data) {
bean = app.data.createBean(data._module,data);
app.drawer.open({
layout : 'inviteportal',
context : {
create : true,
model : bean,
module : bean.get('_module')
}
});
},
error: function() {
return;
}
}
);
},
})
I found the problem , In subpanel-list.php in 7.7 version
'template' => 'recordlist',
Now in 7.8 version it is.
'template' => 'flex-list',

Meteor audit-argument-checks

I have a Meteor project where I'm using audit-argument-check. I'm getting an error message
Error: Did not check() all arguments during publisher 'document
I'm know this is related the audit-argument-check not being able to check all arguments. But as far as I'm concerned, I checked all of them. Concrete, I have defined a collection 'documents' and attached a SimpleSchema. As part of iron-router, I have the following:
Router.route('customerDocumentShow', {
template: 'customerDocumentShow',
path: 'customer/documents/:_id',
waitOn: function () {
return Meteor.subscribe('document', this.params._id);
},
data: function () {
return Documents.findOne(this.params._id);
}
});
So I'm passing only the documentId (this.params._id). On the server, I have defined a method:
Meteor.methods({
documentsReadMethod: function(documentId){
check(documentId, String);
var documentItem = Document.findOne(argument);
if (!documentItem) {
throw new Meteor.Error(500, 'Error 500: Not Found', 'No documents found.');
}
return documentItem;
}
});
So I'm checking to documentId in the server method. So not sure why I'm getting this error message.
Note: One thing I'm not entirely sure about though is how I need to call this method (right now, it's documentsReadMethod_. I'm not explicitly calling (on the client):
Meteor.call(documentsReadMethod, this.params_id);
as I'm using autoform, collection2 and simpleschema. I've been spending the entire weekend, but have no clue. Any idea's ?
Note: the code is on github: https://github.com/wymedia/meteor-starter-base
The problem is in the publish. You didn't check the id here:
https://github.com/wymedia/meteor-starter-base/blob/master/server/publications/documents.js#L16
Just add check(id, String); line 16 and it should work.
I have the same problem with another tuto !
Answer found at check is not defined in meteor.js : since Meteor v1.2, you have to add this package:
$ meteor add check

Meteor -> percolatestudio/meteor-migrations --- not working for version 0

Trying to get this migrations plugin working for meteor project: percolatestudio/meteor-migrations
Migrating up and down between various migration versions seems to work fine when greater than 0.
However when trying to migrate back to 0 (clean slate), it doesn't seem to work. Nothing happens --- no errors, and it still thinks it is at the last version it migrated to.
Here is my code for a simple migration:
Migrations.add({
version: 1,
name: 'Add engagement and lastActiveAt fields to cloud users for analytics',
up: function() {
CloudUsers.update({}, { $set: { lastActiveAt: Date.now(), engagements: {} } }, { multi: true });
},
down: function() {
CloudUsers.update({}, { $unset: { lastActiveAt: '', engagements: '' } }, { multi: true });
}
});
It successfully migrates up(), but will not migrate back down() to 0. However if I copy & paste this code and create a version 2 migration. I can successfully migrate up and down between the two.
I am following the documentation on how to revert back to version 0:
Migrations.migrateTo(0)
This was a bug with that specific version, the latest version now has fixed this issue.

Resources