Postings by Jeff Greenberg
I've selected rewrite output in a field, and added
in the text block, and have put the same in
the block in the field Global: Custom text. The html doesn't show up in
the output of either. Scratching my head.
I've been staring at this an hour now...time go ask for help! I have
two reports. The menu entries are below. Each works. They are identical
other than name.
At the top of each, I provide a button to request a CSV. The report's
callback checks for the get value associated with the button. The
buttons are each submits.
The action for the form in each report is the final part of the callback
path.
Report 1 successfully returns to the callback function for it. Report 2,
when the button is clicked, just spins and spins. If I change the action
in report 2 to 'customers'...
I have a view row template, and one of the fields in the row is an
imagecache version of a cck image. If I elect for the field settings of
it to allow it to be shown, the image appears.
The last interesting requirement is sort of like creating a new post in
a forum, in that the node, once created, can be edited, based on
permissions, like normal, but only for an amount of time selectable
(globally) in the admin panel. So the user who creates the node can edit
it for 12 hours, after which the ability to edit it goes away.
The second requirement is this: Let's say I have a document type, and
one of the cck fields is a comment box, and that multiple are supported
for the content type. Then, each comment has a status, active or
closed. Each customer might have multiple nodes. I need a view (or
equivalent) to take all the comments from a given customer's nodes and
populate a popup with them in row format. Not a big deal so far. But,
each comment and its status must be editable on this popup, where the
edit will be saved in the original node.
Hi. I have a new site to do, and (so far) there are 3 things I haven't
done before in Drupal. I'll make each a different message so the thread
doesn't get confused.
The first one is what is/used-to-be? called a combo box. That is, a
select box that also allows one to type in an entry if none of the
options will do.
I asked about this at #drupal-support, and am waiting for an answer, but
when I Googled it (+unserialize +"Error at offset" +"bootstrap.inc") I
received 220,000 postings, so maybe this is a big issue I missed?
Unserialize error at offset x of y bytes in boostrap.inc?
Haven't delved into AHAH yet, this might force the issue.
Using an easy (=less typing) example. A credit card form. When the
credit card type is selected from a select, the selection needs to fire
a javascript function that will disable fields that don't apply to that
card type (such as CVV).
Normally, I would have an onchange event for the select, and noticed
that in the form api, while there is an attribute section to add
miscellaneous attributes, the doc doesn't mention events as examples.
Never mind. It turned out to be a dual problem with two ssl certificates
not being allowed on one IP (so they turned one off without mentioning
it), and a bug in securepages.
Having an interesting problem, which I'm thinking is related to some
internal security feature regarding the invoking of admin pages.
A site I'm working on can have two different incoming URL's. If one, a
certain banner should be used, if another, then another.
The initial problem was that there's a cart, and certain pages are SSL,
and the securepages module can't handle two possible SSL URL's. There's
a SSL certificate for both.
I figure others like me use shared hosting for their test and/or
development servers. Thought you'd like to know that what I found out
midstream in a project, with Views tossing errors at me with the
Ubercart views. HostMonster doesn't support mysql views. I asked why
they feel they support Drupal, and they said that they do, just not
views. I said that's like saying they support it, just not php. Their
response was, "Actually its like saying we support a Car being in our
garage..
I've run into a problem that I can't resolve with the docs because
there's no usage examples (I know, I know...but I can't write it if I
don't know it).
D6. I need to create a file. Seems simple. But I can't determine what
combination of variables give me a good path.
I'm confused with the db_last_insert_id function in
database.mysql-common.inc.
The function is:
function db_last_insert_id($table, $field) {
return db_result(db_query('SELECT LAST_INSERT_ID()'));
}
and I see no reason whatsoever for there to be any parameters, let alone
required ones.
In D6, I have the page url of mypage.com/catalog/16?page=0%2C1
I have the following snipped in the pages section of a block, with the
PHP snippet option chosen:
<?php
if ($_GET['q']) {
$my_drupal_path = $_GET['q'];
} else { $my_drupal_path = substr($_SERVER['REQUEST_URI'], 1);
}
if ( stristr($my_drupal_path, 'catalog/16?page=0%2C0') ||
((stristr($my_drupal_path, 'catalog/16')) &&
(stristr($my_drupal_path, 'catalog/16?page')===false))
) return true;
else return false;
?>
So the idea is that it will be TRUE for /catalog/16 and for
/catalog/16?page=02C0 but not for page=02C
I'm working on a site that can be invoked via two different url's
(mapped to the same directory). The requested url will dictate what top
banner the site uses. Also, because there are likely many places in the
site that $base_url is used, and the url appearing throughout the
session should be that which was initially used, I will need to alter
$base_url.
So, I'm thinking I should just hook_init, and based on the http request,
alter $base_url if needed, and do a variable_set that I later retrieve
in the theme to alter (or not) the background-image used as the top
banner.
I'm using content_profile, and need to have an admin user report that
lists user info including the profile fields. It seems that
content_profile exposes itself in some templates, but not as a global
(such as $user) or to views. If I create a user view, I can't get to the
content_profile node I think, and vice-versa. Any thoughts would be
appreciated!
So, here's another example (I think) of what I would consider CVS
censorship. I've spent a couple hours already today trying to get a
simplenews subscription checkbox onto the Ubercart checkout. Found the
function in simplenews, but it has a parm that I can't find the source
of, etc. Busy work that I don't need.
I find an entry at Ubercart after much searching, for a module that was
developed -just for this- requirement.
I can't get this form to programatically display (not part of any
callback) and wait for a submission.
I call it, and it fires the function that creates the form array, but I
never see the form unless I put 'exit' after it.
When using drupal_execute, is the 'values' array of $form_state
required, with each field named? My $form_state array is empty. I
didn't think I needed the enumerated 'values' array because I assumed
(yes, I know...) that the #default entries in the form elements
accomplish what I need.
I'm using the secondary menu to put a few links at the top right of the
screen. Among them should be login (if not already) and logout (if
logged in). Adding them to the menu is, of course, not an issue, but how
would I control their appearing or not based on whether the user is
logged in? I was going to use hook_menu_alter, but for some odd reason
it doesn't fire when I'm not on an admin page. Something tells me this
is going to be a forehead slapping moment, it seems so trivial, but it's
eluding me.
I hook menu with an item $items['admin/....'] and give it a page
callback of drupal_get_form and the page arguments being the function in
my module that defines the form. It's defined as a normal menu item.
I click the menu item and up comes the form. So far everything as
expected. What -isn't- expected is that in looking at the page source,
the action for both this form, and the search form, are now both the
path for this form.
I'm having a devil of a time. I need to replace the Ubercart catalog
page with my own. They don't use a template, so I've created a view and
will just change my menu links to suit (cat instead of catalog). The
title of the page needs to be the taxonomy term of the product. There's
no setting for that in view. So I will have the taxonomy term as a field
that isn't displayed, and grab it in the template and use it for the title.
The first problem is that Taxonomy Term as a field choice does not all
specifying a vocabulary ID.
I've opened an issue, but meanwhile, has anyone used form_markup - d6?
I enabled it, the prefix/suffix fields appear when I edit a cck field. I
put markup in. Save. Clear cache (just in case). And the node/add and
edit forms don't change at all. I need to plant a line of textual
instruction prior to the start of a series of groups on the form, and
was hoping not to have to theme just to do that. Unfortunately, there's
no cck markup type field.
I'm hooking hook_form_MY_FORM_ID_alter in order to add additional fields
to the form. The current fields have associative keys ('name', 'mail').
How do I add fields between them? There isn't a PHP call to do an insert
into the middle of an array, and while using array_splice works, it
won't use associative keys. The numeric keys result in the form looking
ok, but when I ask the CAPTCHA module to give me a link on the form, it
puts it right between the first field (associative key) and the first
that I inserted (numeric key), which I think has something to do with
the key problem.
I'd be interested in hearing opinions, on a % scale, of how much
reeducation is needed to move from D6 to D7 in terms of the api, hooks,
architecture, admin functions... for a D6 developer to be at the same
level of capability with D7.
|